how to install/start docker engine service inside a docker container how to install/start docker engine service inside a docker container jenkins jenkins

how to install/start docker engine service inside a docker container


You need to run the container as a privileged container if you want to run docker inside docker.

So something like this (1) is required:

docker run --privileged your_image:tag

You also need to be careful with iptables and App Armour, but this works after a bit of tinkering.


The alternative is to give access to the docker daemon inside the container, like so (2):

docker run -v /var/run/docker.sock:/var/run/docker.sock your_image:tag

Ref:

1 https://blog.docker.com/2013/09/docker-can-now-run-within-docker/

2 https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/