Skip to main content
 首页 » 编程设计

docker之Docker 中的容器运行时在哪里执行

2024年12月31日33exmyth

我是 Docker 的新手,最近正在阅读一本关于它的书。据说 containerd 使用 runc 来创建和运行容器,而 runc 是容器运行时。一切都很好,直到我了解了 shim。创建容器后,runc 退出并将容器交给 shim。这让我感到困惑。如果 runc 是容器运行的地方,它在创建容器后如何退出?

请您参考如下方法:

这个问题想得很周到。
我可以引用 here 得到答案

Containerd doesn’t actually create the container runtime. It sets up the environment and then invokes containerd-shim to start the container runtime via the configured OCI runtime (controlled with the containerd “–runtime” option) . For most modern systems the container runtime is based on runc.



希望这可以帮助。让我知道。