Skip to content
This repository has been archived by the owner on Jun 3, 2022. It is now read-only.
/ jenkins-dind Public archive

Docker image of jenkins slave plus docker in docker to build docker while using the jenkins docker plugin

License

Notifications You must be signed in to change notification settings

m1no/jenkins-dind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jenkins-dind

Outdated

This repository is outdated. If you are looking for the newer project please follow here: dind-builder. This project here will not be maintained anymore.

Yo dawg, I herd you like Docker, so I put an Jenkins in your Docker so you can Docker while you Docker

Requirements

This docker container is intended to be used together with the Jenkins Docker Plugin.

Setup

  • Check that the required module, as stated above is installed
  • Add a new credential in Jenkins with Username: jenkins and Password: jenkins
  • Configure a new docker cloud in your Jenkins settings (Manage Jenkins->Configure System)
  • Give it a name and a valid docker URL like http://my.docker.host:2375
  • Test the connection
  • Add this image from the public registry to that cloud with the ID: m1no/jenkins-dind
  • Give that image a valid build label (ex.:"docker") to point your build jobs to it
  • Select the newly created credential from before to allow the Jenkins Master to connect via ssh to the new Docker Jenkins slave
  • Click the "Advanced..." button for that image
  • Enable "Run container privileged" mode
  • Create a new build job and set the option "Restrict where this project can be run" to the new build label (ex.:"docker")
  • Do your build steps as usual

After running a build you should see that Jenkins start a new docker container everytime you trigger this job to build. Shortly after triggerin the Build, there will be a notice that the job is pending on the build instance, this is totally normal. After the brand new slave is fully operational this should go over in to "Building".

Usage

  • At our office we use it to build all our jobs in docker containers even other docker containers
  • It helps a lot to have a deterministic docker build setup all the time

Known Issues

  • The Docker Plugin of Jenkins does not clean the attached container volumes => Manual cleanup needed on the Docker main host regularly rm -Rf /var/lib/docker/vfs/dir/*

About

Docker image of jenkins slave plus docker in docker to build docker while using the jenkins docker plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages