Docker Community Forums

Share and learn in the Docker community.

Docker in docker ubuntu


#1

I have used docker ubuntu16.04 image , but when I install docker in this container , it’s faild ,so I need some solution about this,how can I solve it??? please help.


(Metin Y.) #2

please paste your docker run line or your docker-compose.yml.

Actualy, you can mount the docker binary and the socket into the container as a volume. Though, this will result in Controlling the hosts docker deamon and NOT a separate docker daemon inside the container. If you realy need that, you might take a look at -dind Tags on the docker repo on Dockerhub.


#3

haode, thank you , I want to use docker directly as a real Ubuntu, So I “apt-get install docker.io”,
then I get this false,


I actually want to use the docker ubuntu as a real Ubuntu(like a vitual machine),so can you tell me Is that possible?


(Metin Y.) #4

Sort of yes!

Since your container actualy already uses your hosts kernel, a docker engine inside a container will use it as well and all the containers it starts.

Thus, with a Docker in Docker Image you get an isolation with objects private to the itself. It appears to be like on a vm, even though it is not :slight_smile:

see: http://blog.teracy.com/2017/09/11/how-to-use-docker-in-docker-dind-and-docker-outside-of-docker-dood-for-local-ci-testing/