{"id":26658240,"url":"https://github.com/deep110/coal","last_synced_at":"2025-04-11T13:07:56.346Z","repository":{"id":38335975,"uuid":"180829965","full_name":"deep110/coal","owner":"deep110","description":"Linux container creating tool like docker for learning purposes","archived":false,"fork":false,"pushed_at":"2022-07-19T04:25:48.000Z","size":232,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T09:19:04.065Z","etag":null,"topics":["container","docker","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deep110.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-11T16:13:09.000Z","updated_at":"2023-03-04T10:00:55.000Z","dependencies_parsed_at":"2022-08-24T22:31:40.137Z","dependency_job_id":null,"html_url":"https://github.com/deep110/coal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep110%2Fcoal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep110%2Fcoal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep110%2Fcoal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep110%2Fcoal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deep110","download_url":"https://codeload.github.com/deep110/coal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248404526,"owners_count":21097767,"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":["container","docker","rust"],"created_at":"2025-03-25T09:19:07.024Z","updated_at":"2025-04-11T13:07:56.321Z","avatar_url":"https://github.com/deep110.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# coal\nLinux container like docker for learning purposes\n\n![](demo/output.gif)\n\n### Setup\n\n1. If you don't have rust installed, follow the instructions [here](https://www.rust-lang.org/tools/install).\n\n2. Clone and build the repository\n```shell\ngit clone https://github.com/deep110/coal.git\ncd coal \u0026\u0026 cargo build\n```\n\n3. Download alpine file system and unzip into folder named **alpine**. We will use this as a base image.\n```\nwget http://dl-cdn.alpinelinux.org/alpine/v3.9/releases/x86_64/alpine-minirootfs-3.9.4-x86_64.tar.gz\nmkdir alpine \u0026\u0026 tar -xzf alpine-minirootfs-3.9.4-x86_64.tar.gz -C alpine\n```\n\n### Running the container\nIf you are running from debug build:\n```\nsudo target/debug/coal run /bin/sh\n```\nIn place of bash you can run any command that will be available in alpine by default.\n\n### Implemented [As shown in demo]\n* A new process is started in run command\n* Container has its own PID tree, host and network\n* Limit on number of process using control groups\n\n\n### Reading Material / libc functions used\n* [Fork](http://man7.org/linux/man-pages/man2/fork.2.html)\n* [Clone](http://man7.org/linux/man-pages/man3/exec.3.html)\n* [Chroot](http://man7.org/linux/man-pages/man2/chroot.2.html)\n* [Mount](http://man7.org/linux/man-pages/man2/mount.2.html)\n* [Clone](http://man7.org/linux/man-pages/man2/clone.2.html)\n\n\n### TODO\n1. Making an `exec` command like docker.\n2. Mounting additional volumes and folders.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep110%2Fcoal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeep110%2Fcoal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep110%2Fcoal/lists"}