{"id":21068555,"url":"https://github.com/aditya1404sal/contain-it","last_synced_at":"2026-05-20T03:37:20.892Z","repository":{"id":246089882,"uuid":"820069938","full_name":"Aditya1404Sal/Contain-it","owner":"Aditya1404Sal","description":"This is a simple mock containerization tool written in Go. It mimics the behavior of basic container operations like pulling an image, unpacking it, and running commands within a new namespace","archived":false,"fork":false,"pushed_at":"2024-09-18T17:10:18.000Z","size":32616,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T21:38:18.614Z","etag":null,"topics":["containers","docker","rootfs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aditya1404Sal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-25T18:28:48.000Z","updated_at":"2024-09-18T17:10:23.000Z","dependencies_parsed_at":"2024-06-25T20:24:37.632Z","dependency_job_id":"a30262a9-dd97-40e8-8d5e-1a245ecd2874","html_url":"https://github.com/Aditya1404Sal/Contain-it","commit_stats":null,"previous_names":["aditya1404sal/container-scaffold","aditya1404sal/contain-it"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya1404Sal%2FContain-it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya1404Sal%2FContain-it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya1404Sal%2FContain-it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya1404Sal%2FContain-it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aditya1404Sal","download_url":"https://codeload.github.com/Aditya1404Sal/Contain-it/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243510056,"owners_count":20302296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containers","docker","rootfs"],"created_at":"2024-11-19T18:23:09.547Z","updated_at":"2026-05-20T03:37:15.861Z","avatar_url":"https://github.com/Aditya1404Sal.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contain-it : A Mock Containerization Tool\n\n# MVP Status :  not ready\nTODO : Implement Root-fs extraction\n\nThis is a simple mock containerization tool written in Go. It mimics the behavior of basic container operations like pulling an image, unpacking it, and running commands within a new namespace. This tool does not fully replicate Docker's functionality but provides a lightweight alternative for educational purposes.\n\n## Features\n\n- Pull Docker images and save them as tar.gz archives.\n- Unpack the archives and run commands within new namespaces.\n- Use cgroups to limit resources.\n- Chroot to the unpacked image root filesystem.\n\n## Usage\n\n### Commands\n\n1. **run**: Run a command inside a new container.\n   ```sh\n   ./cnts run \u003cimage\u003e \u003ccommand\u003e\n   ```\n   Example:\n   ```sh\n   ./cnts run ubuntu /bin/sh\n   ```\n\n2. **child**: This is an internal command used by `run`. It sets up the new namespaces and executes the command.\n\n3. **pull**: Pull a Docker image and store it as a tar.gz archive.\n   ```sh\n   ./cnts pull \u003cimage\u003e\n   ```\n   Example:\n   ```sh\n   ./cnts pull ubuntu\n   ```\n\n### Pull Script\n\nThe `pull` script is a helper bash script to fetch Docker images, export their filesystem, and save it to the `assets` directory.\n\n```sh\n#!/bin/bash\n\nset -e\n\ndefaultImage=\"hello-world\"\n\nimage=\"${1:-$defaultImage}\"\ncontainer=$(docker create \"$image\")\n\ndocker export \"$container\" -o \"./assets/${image}.tar.gz\" \u003e /dev/null\ndocker rm \"$container\" \u003e /dev/null\n\ndocker inspect -f '{{.Config.Cmd}}' \"$image:latest\" | tr -d '[]\\n' \u003e \"./assets/${image}-cmd\"\n\necho \"Image content stored in assets/${image}.tar.gz\"\n```\n\n## Building and Running\n\n1. Build the Go program:\n   ```sh\n   go build -o cnts\n   ```\n\n2. Make the `pull` script executable:\n   ```sh\n   chmod +x pull\n   ```\n\n3. Use the commands as described above.\n\n\u003e **Note**: You need to run these commands as root:\n\u003e ```sh\n\u003e root@device:~# ./cnts run \u003cimage\u003e \u003ccommand\u003e\n\u003e root@device:~# ./cnts pull \u003cimage\u003e\n\u003e ```\n\n## Note\n\nThis tool is for educational purposes and is not intended for production use. It demonstrates basic containerization concepts like namespaces and cgroups without the complexity and features of full-fledged container runtimes like Docker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya1404sal%2Fcontain-it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faditya1404sal%2Fcontain-it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya1404sal%2Fcontain-it/lists"}