Is it possible to create a docker container that c

2019-01-15 02:43发布

问题:

I am want to create a docker container which contains one or more containers. Is it possible with docker? I am not able to find relevant info on the web.

Thanks!

回答1:

To run docker inside docker is definitely possible. The main thing is that you run the outer container with extra privileges (starting with --privileged=true) and then install docker in that container.

Check this blog post for more info: Docker-in-Docker.

One potential use case for this is described in this entry. The blog describes how to build docker containers within a Jenkins docker container.

However, Docker inside Docker it is not the recommended approach to solve this type of problems. Instead, the recommended approach is to create "sibling" containers as described in this post



标签: docker