{"id":20917537,"url":"https://github.com/impact-eintr/docker-ece","last_synced_at":"2025-05-13T12:30:50.681Z","repository":{"id":46426394,"uuid":"336284940","full_name":"impact-eintr/Docker-ECE","owner":"impact-eintr","description":"支持cgroup2和overlay2的docker引擎,《自己动手写docker》的学习笔记 ,球球大佬们给个star","archived":false,"fork":false,"pushed_at":"2023-08-21T10:46:27.000Z","size":12997,"stargazers_count":30,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-15T04:39:19.265Z","etag":null,"topics":["docker","docker-compose","docker-image"],"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/impact-eintr.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}},"created_at":"2021-02-05T13:50:20.000Z","updated_at":"2024-06-15T18:11:20.000Z","dependencies_parsed_at":"2022-09-26T16:20:18.916Z","dependency_job_id":"7a62d9c3-eee9-42e3-b24a-35fca90968b5","html_url":"https://github.com/impact-eintr/Docker-ECE","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/impact-eintr%2FDocker-ECE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/impact-eintr%2FDocker-ECE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/impact-eintr%2FDocker-ECE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/impact-eintr%2FDocker-ECE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/impact-eintr","download_url":"https://codeload.github.com/impact-eintr/Docker-ECE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225208638,"owners_count":17438209,"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":["docker","docker-compose","docker-image"],"created_at":"2024-11-18T16:33:59.976Z","updated_at":"2024-11-18T16:34:00.176Z","avatar_url":"https://github.com/impact-eintr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker-ECE\n支持cgroup2和overlay2的容器运行时\n\n### 安装\n\n``` bash\ngh repo clone impact-eintr/Docker-ECE\n\ncd Docker-ECE\n\ngo build\n\nsudo ./Docker-ECE\n```\n\n### 简单使用\n\n``` bash\nsudo ./Docker-ECE run -it /bin/sh \n\nINFO[0000] Docker-ECE is a simple container runtime implementation\n/bin/sh\nINFO[0000] Docker-ECE is a simple container runtime implementation\n{\"level\":\"info\",\"msg\":\"init come on\",\"time\":\"2021-11-23T11:18:12+08:00\"}\n{\"level\":\"info\",\"msg\":\"command \",\"time\":\"2021-11-23T11:18:12+08:00\"}\n{\"level\":\"info\",\"msg\":\"read parent pipe cmd\",\"time\":\"2021-11-23T11:18:12+08:00\"}\n{\"level\":\"info\",\"msg\":\"command all is /bin/sh\",\"time\":\"2021-11-23T11:18:12+08:00\"}\n{\"level\":\"info\",\"msg\":\"receive /bin/sh\",\"time\":\"2021-11-23T11:18:12+08:00\"}\n{\"level\":\"info\",\"msg\":\"Current location is [/var/lib/docker-ece/HEZDENJXG43TQMBT/merge]\",\"time\":\"2021-11-23T11:18:12+08:00\"}\n{\"level\":\"info\",\"msg\":\"now change dir to root\",\"time\":\"2021-11-23T11:18:12+08:00\"}\n/ # export PATH=/bin\n/ # ls\nbin   dev   etc   home  proc  root  sys   tmp   usr   var\n\n```\n\n### 使用已有的镜像\n\n这里就先使用docker导出的镜像了\n\n``` bash\ndocker run -it ubuntu /bin/bash \n\ndocker ps\nCONTAINER ID   IMAGE       COMMAND                  CREATED        STATUS                   PORTS     NAMES\nde8196e01926   ubuntu      \"/bin/bash\"              2 weeks ago    Exited (0) 2 weeks ago             beautiful_hoover\n\ndocker export -o myubuntu.tar de8196e01926\n\n# 将镜像放到指定位置 Docker-ECE/Images 否则找不到\n\nmv myubuntu.tar Docker-ECE/Images\n```\n\n注意名字要对上 不需要加`.tar` 直接名字就行\n\n``` bash\nsudo ./Docker-ECE run -it --image myubuntu /bin/bash\n\n## 以下是正确进入一个ubuntu容器的样子\n\nINFO[0000] Docker-ECE is a simple container runtime implementation\n/bin/bash\nINFO[0000] Docker-ECE is a simple container runtime implementation\n{\"level\":\"info\",\"msg\":\"init come on\",\"time\":\"2021-11-23T10:49:57+08:00\"}\n{\"level\":\"info\",\"msg\":\"command \",\"time\":\"2021-11-23T10:49:57+08:00\"}\n{\"level\":\"info\",\"msg\":\"read parent pipe cmd\",\"time\":\"2021-11-23T10:49:57+08:00\"}\ncgroup2\n{\"level\":\"info\",\"msg\":\"command all is /bin/bash\",\"time\":\"2021-11-23T10:49:57+08:00\"}\n{\"level\":\"info\",\"msg\":\"receive /bin/bash\",\"time\":\"2021-11-23T10:49:57+08:00\"}\n{\"level\":\"info\",\"msg\":\"Current location is [/var/lib/docker-ece/GMZTEOJVGIZDCMBZ/merge]\",\"time\":\"2021-11-23T10:49:57+08:00\"}\n{\"level\":\"info\",\"msg\":\"now change dir to root\",\"time\":\"2021-11-23T10:49:57+08:00\"}\nroot@Code01:/# ls\nbin   dev  home  lib32  libx32  mnt  proc  run   srv  tmp  var\nboot  etc  lib   lib64  media   opt  root  sbin  sys  usr\nroot@Code01:/# ps\n    PID TTY          TIME CMD\n      1 ?        00:00:00 bash\n     11 ?        00:00:00 ps\n\n\n```\n\n### 容器联网\n\n先看一下本地的DNS\n\n``` bash\ncat /etc/resolv.conf\n```\n\n``` bash\n\u003e sudo ./Docker-ECE run -it --net test /bin/sh\n[sudo] eintr 的密码：\nINFO[0000] Docker-ECE is a simple container runtime implementation\n/bin/sh\nINFO[0000] Docker-ECE is a simple container runtime implementation\n{\"level\":\"info\",\"msg\":\"init come on\",\"time\":\"2021-11-23T11:38:04+08:00\"}\n{\"level\":\"info\",\"msg\":\"command \",\"time\":\"2021-11-23T11:38:04+08:00\"}\n{\"level\":\"info\",\"msg\":\"read parent pipe cmd\",\"time\":\"2021-11-23T11:38:04+08:00\"}\n{\"level\":\"info\",\"msg\":\"command all is /bin/sh\",\"time\":\"2021-11-23T11:38:04+08:00\"}\n{\"level\":\"info\",\"msg\":\"receive /bin/sh\",\"time\":\"2021-11-23T11:38:04+08:00\"}\n{\"level\":\"info\",\"msg\":\"Current location is [/var/lib/docker-ece/GIYTQNZVGU2TMMZV/merge]\",\"time\":\"2021-11-23T11:38:04+08:00\"}\n{\"level\":\"info\",\"msg\":\"now change dir to root\",\"time\":\"2021-11-23T11:38:04+08:00\"}\n/ # export PATH=/bin\n/ # echo \"nameserver 61.139.2.69\" \u003e /etc/resolv.conf // 把查出来的DNS添进去\n/ # ping www.baidu.com\nPING www.baidu.com (14.215.177.38): 56 data bytes\n64 bytes from 14.215.177.38: seq=0 ttl=53 time=36.101 ms\n64 bytes from 14.215.177.38: seq=1 ttl=53 time=34.067 ms\n64 bytes from 14.215.177.38: seq=2 ttl=53 time=34.307 ms\n64 bytes from 14.215.177.38: seq=3 ttl=53 time=33.259 ms\n^C\n--- www.baidu.com ping statistics ---\n4 packets transmitted, 4 packets received, 0% packet loss\nround-trip min/avg/max = 33.259/34.433/36.101 ms\n/ #\n\n```\n\n# 《自己动手写docker》的学习笔记\n## 基础知识\n\u003chttps://github.com/impact-eintr/Docker-ECE/tree/main/note/basic/README.md\u003e\n\n## 容器网络\n\u003chttps://github.com/impact-eintr/Docker-ECE/blob/main/note/network/README.md\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimpact-eintr%2Fdocker-ece","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimpact-eintr%2Fdocker-ece","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimpact-eintr%2Fdocker-ece/lists"}