{"id":13415854,"url":"https://github.com/p8952/bocker","last_synced_at":"2026-01-25T09:38:36.209Z","repository":{"id":37580341,"uuid":"39103837","full_name":"p8952/bocker","owner":"p8952","description":"Docker implemented in around 100 lines of bash","archived":false,"fork":false,"pushed_at":"2017-12-09T14:16:38.000Z","size":373,"stargazers_count":11218,"open_issues_count":12,"forks_count":714,"subscribers_count":272,"default_branch":"master","last_synced_at":"2024-07-31T21:54:43.129Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.p8952.info/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p8952.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":"2015-07-14T22:33:49.000Z","updated_at":"2024-07-31T09:25:45.000Z","dependencies_parsed_at":"2022-07-12T16:24:48.359Z","dependency_job_id":null,"html_url":"https://github.com/p8952/bocker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/p8952/bocker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p8952%2Fbocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p8952%2Fbocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p8952%2Fbocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p8952%2Fbocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p8952","download_url":"https://codeload.github.com/p8952/bocker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p8952%2Fbocker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28750879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T09:00:19.176Z","status":"ssl_error","status_checked_at":"2026-01-25T09:00:04.131Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-07-30T21:00:52.545Z","updated_at":"2026-01-25T09:38:36.185Z","avatar_url":"https://github.com/p8952.png","language":"Shell","readme":"# Bocker\nDocker implemented in around 100 lines of bash.\n\n  * [Prerequisites](#prerequisites)\n  * [Example Usage](#example-usage)\n  * [Functionality: Currently Implemented](#functionality-currently-implemented)\n  * [Functionality: Not Yet Implemented](#functionality-not-yet-implemented)\n  * [License](#license)\n\n## Prerequisites\n\nThe following packages are needed to run bocker.\n\n* btrfs-progs\n* curl\n* iproute2\n* iptables\n* libcgroup-tools\n* util-linux \u003e= 2.25.2\n* coreutils \u003e= 7.5\n\nBecause most distributions do not ship a new enough version of util-linux you will probably need to grab the sources from [here](https://www.kernel.org/pub/linux/utils/util-linux/v2.25/) and compile it yourself.\n\nAdditionally your system will need to be configured with the following:\n\n* A btrfs filesystem mounted under `/var/bocker`\n* A network bridge called `bridge0` and an IP of 10.0.0.1/24\n* IP forwarding enabled in `/proc/sys/net/ipv4/ip_forward`\n* A firewall routing traffic from `bridge0` to a physical interface.\n\nFor ease of use a Vagrantfile is included which will build the needed environment.\n\nEven if you meet the above prerequisites you probably still want to **run bocker in a virtual machine**. Bocker runs as root and among other things needs to make changes to your network interfaces, routing table, and firewall rules. **I can make no guarantees that it won't trash your system**.\n\n## Example Usage\n\n```\n$ bocker pull centos 7\n######################################################################## 100.0%\n######################################################################## 100.0%\n######################################################################## 100.0%\nCreated: img_42150\n\n$ bocker images\nIMAGE_ID        SOURCE\nimg_42150       centos:7\n\n$ bocker run img_42150 cat /etc/centos-release\nCentOS Linux release 7.1.1503 (Core)\n\n$ bocker ps\nCONTAINER_ID       COMMAND\nps_42045           cat /etc/centos-release\n\n$ bocker logs ps_42045\nCentOS Linux release 7.1.1503 (Core)\n\n$ bocker rm ps_42045\nRemoved: ps_42045\n\n$ bocker run img_42150 which wget\nwhich: no wget in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)\n\n$ bocker run img_42150 yum install -y wget\nInstalling : wget-1.14-10.el7_0.1.x86_64                                  1/1\nVerifying  : wget-1.14-10.el7_0.1.x86_64                                  1/1\nInstalled  : wget.x86_64 0:1.14-10.el7_0.1\nComplete!\n\n$ bocker ps\nCONTAINER_ID       COMMAND\nps_42018           yum install -y wget\nps_42182           which wget\n\n$ bocker commit ps_42018 img_42150\nRemoved: img_42150\nCreated: img_42150\n\n$ bocker run img_42150 which wget\n/usr/bin/wget\n\n$ bocker run img_42150 cat /proc/1/cgroup\n...\n4:memory:/ps_42152\n3:cpuacct,cpu:/ps_42152\n\n$ cat /sys/fs/cgroup/cpu/ps_42152/cpu.shares\n512\n\n$ cat /sys/fs/cgroup/memory/ps_42152/memory.limit_in_bytes\n512000000\n\n$ BOCKER_CPU_SHARE=1024 \\\n\tBOCKER_MEM_LIMIT=1024 \\\n\tbocker run img_42150 cat /proc/1/cgroup\n...\n4:memory:/ps_42188\n3:cpuacct,cpu:/ps_42188\n\n$ cat /sys/fs/cgroup/cpu/ps_42188/cpu.shares\n1024\n\n$ cat /sys/fs/cgroup/memory/ps_42188/memory.limit_in_bytes\n1024000000\n```\n\n## Functionality: Currently Implemented\n\n* `docker build` †\n* `docker pull`\n* `docker images`\n* `docker ps`\n* `docker run`\n* `docker exec`\n* `docker logs`\n* `docker commit`\n* `docker rm` / `docker rmi`\n* Networking\n* Quota Support / CGroups\n\n† `bocker init` provides a very limited implementation of `docker build`\n\n## Functionality: Not Yet Implemented\n\n* Data Volume Containers\n* Data Volumes\n* Port Forwarding\n\n## License\n\nCopyright (C) 2015 Peter Wilmott\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","funding_links":[],"categories":["Container Operations","Shell","HarmonyOS","Dev Tools","🔮学完docker或许你可以试试这些","Containers","Tutorials","others","For Developers","\u003ca name=\"vm\"\u003e\u003c/a\u003eContainerization and virtualization"],"sub_categories":["Container Composition","Windows Manager","建立你自己的`Docker`","Directory Navigation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp8952%2Fbocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp8952%2Fbocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp8952%2Fbocker/lists"}