是否可以在 docker 中启动真正的 docker 守护进程?

Is it possible to start real docker daemon in docker?

出于某种原因,我需要 运行 docker 在另一个 docker 中。 映射 docker.socket 不是一个选项,我需要真正的 docker 守护进程在 docker.

内启动

有人知道这是否可行吗?

这就是 jpetazzo/dind 几年前的实验。

今天(2​​018),如果你想运行Docker-in-Docker今天,你需要做的就是:

docker run --privileged -d docker:dind

他补充道:

... And that's it; you get Docker running in Docker, thanks to the official Docker image, in its "Docker-in-Docker" flavor.
You can then connect to this Docker instance by starting another Docker container linking to the first one (which is a pretty amazing thing to do).

查看其official documentation