Public | Automated Build

Last pushed: a year ago
Short Description
hdt
Full Description

docker-in-docker

This is a docker in docker repo based on centos7. There are two ways for you to accomplish this task.

##One way to Run This Container
One way to get you started in an easy way is by using your host docker.

docker run -it -v /var/run/docker.sock:/var/run/docker.sock  softputer/dockerindocker:latest /bin/bash

You can also just use -v /usr/bin/docker:/usr/bin/docker to avoid installing docker in your image.

In the bash, you can use excute docker command to manipulate host docker resources.

In this way, it's convenient for scheuling docker tasks among a cluster of hosts. But without resource limitations, it may be not a good way to accomplish this.

##Another Way
We can also do this by wrapping docker environment in a docker container just as jpetazzo did. The wrapdocker script is from jpetazzo's repo dind .

$ docker run --privileged  -d -p 4444 -e PORT=4444 softputer/dockerindocker:centos7
$ docker ps
CONTAINER ID        IMAGE                                          COMMAND             CREATED             STATUS              PORTS                     NAMES
35843d8173b7        softputer/dockerindocker:centos7   "wrapdocker"        4 seconds ago       Up 1 seconds                                  naughty_jennings
$ docker exec -it 35843d8173b7 /bin/bash

After you get into the container, you can do anything that docker can do in your isolated environment.

By the way, you can just get into it by executing:

docker run --privileged -t -i softputer/dockerindocker:centos7
Docker Pull Command
Owner
softputer
Source Repository

Comments (0)