Skip to content
Generic Jenkins Slave with Docker Engine and Docker Compose inside
Branch: master
Clone or download
Pull request Compare This branch is 2 commits ahead of killercentury:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Jenkins Slave DinD (Docker in Docker)

This Jenkins Slave Docker image inherits the same idea as the master one that provides Docker Engine and Docker Compose inside itself, which allows you to run anything via Docker container in your Jenkins build script. So it also means that you don't need a custom build of Jenkins that pre-install any build tool or runtime anymore. You can provide all these via Docker images in your build script, which guarantees a highly isolated environment between jobs as well.

This Docker image is based on jpetazzo/dind to provide the DinD (Docker in Docker) environment. Supervisord is used to make sure everything has proper permission and launch in the right order. Jenkins Swarm Client is used to connect with the master in an intelligent way. Moreover, Docker Compose is available for launching multiple containers inside the CI.

This Jenkins slave image should be able to connect with any Jenkins master with JNLP enabled, such as killercentury/jenkins-dind and normal Jenkins installed manually or via package manager.


The environment variable COMMAND_OPTIONS has to be specified with non-empty value, which is a combination of all swarm client options you need. Please refer to this Swarm Plugin for all available options.

Following is an example of command used to connect with the master:

docker run --name jenkins-slave-dind --privileged -d -e COMMAND_OPTIONS="-master http://YOUR-JENKINS-MASTER-HOST:YOUR-JENKINS-MASTER-PORT -username YOUR_SLAVE_USERNAME -password YOUR_SLAVE_PASSWORD" killercentury/jenkins-slave-dind
You can’t perform that action at this time.