Public | Automated Build

Last pushed: 10 months ago
Short Description
Docker On Docker Proof Of Concept
Full Description


Working Swarm Mode

docker run -v /lib/modules:/lib/modules:ro -e DOCKER_HOST= --privileged --name dond1 -d dond

--- Docker-On-Docker DEMO ---

First create your cluster using swarm init and swarm join

docker exec dond1 docker swarm init**

docker exec dond2,3,4 docker swarm join ....... whatever role you're going to use for each Docker-On-Docker container....

Let's create a global service inside Docker-On-Cocker Swarm Cluster executing following command ...

docker exec dond1 docker service create --name cagent --mode global --network collectd --env GRAPHITE_SERVER=graphite --env PLUGINS='docker write_graphite' --label service_name='docker-statistics' --mount type=volume,source=COLLECTD_AGENT,target=/DATA,volume-driver=local --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock --mount type=bind,src=/etc/timezone,dst=/etc/timezone --mount type=bind,src=/etc/localtime,dst=/etc/localtime frjaraur/docker-collectd agent**

And start a Graphite container to show data statistics using next command ... it will expose port 8080 inside Docker-On-Docker Swarm translated outside to some of 8081-8084 (remember routing mesh ;P)

docker exec dond1 docker service create --name graphite --network collectd --publish 8080:80 --env RRDDIR=/DATA/collectd/rrd --label service_name='Graphite' --mount type=volume,source=GRAPHITE,target=/var/lib/graphite/storage/whisper,volume-driver=local frjaraur/graphite start*

Finally, start a stress-ng container to take some resources on host and take a look at graphs on graphite

*docker exec dond1 docker service create --name stress frjaraur/docker-stress --cpu 1 --io 2 --vm 1 --vm-bytes 128M

Sample output....
docker exec dond1 docker service ls
1q9xh9dbvwex stress 1/1 frjaraur/docker-stress --cpu 1 --io 2 --vm 1 --vm-bytes 128M
4nj3dg7bl4mq cagent global frjaraur/docker-collectd agent
9u4h84l1ccvh graphite 1/1 frjaraur/graphite start

Docker Pull Command
Source Repository

Comments (0)