A Jenkins image which allows for running Docker in Docker (DinD).
319
A Docker image which allows for running Docker in Docker (DinD). This image is meant to be used with the Jenkins Docker plugin. It allows for Docker containers used as Jenkins build slaves to create and publish their own Docker images in-turn.
This is a mashup of
--privileged in order for nested-Docker to work. There is a check box to enable this for the image within the Jenkins UI.To run a Docker container
docker run -it --rm -e "JENKINS_SLAVE_SSH_PUBKEY=$(cat ~/.ssh/id_rsa.pub)" --privileged -p 2222:22 shiftleft/dind-jenkins-slave
$ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 jenkins@localhost
$ docker run -it --rm hello-world
To use this image with Docker Plugin, you need to
pass the public SSH key using environment variable JENKINS_SLAVE_SSH_PUBKEY and not as a startup argument.
In Environment field of the Docker Template (advanced section), just add:
JENKINS_SLAVE_SSH_PUBKEY=<YOUR PUBLIC SSH KEY HERE>
Don't put quotes around the public key. You should be all set.
Content type
Image
Digest
Size
225.4 MB
Last updated
about 8 years ago
docker pull shiftleft/dind-jenkins-slave