For a new Jenkins experience.
lts
(lts/Dockerfile) - Long term supportlatest
(latest/Dockerfile) - Weekly updates
Based on the Official Jenkins Docker image. This image adds support for running Docker CLI inside the Jenkins container and building the jobs using declarative pipelines with Docker. Bundled with Blue Ocean.
The image is automatically built on any change pushed to the 616slayer616/docker-jenkins repo and/or when original Jenkins image changes.
Pipelines are a series of steps that allow you to orchestrate the work required to build, test and deploy applications. Pipelines are defined in a file called Jenkinsfile
that is stored in the root of your project’s source repository.
Announced at Jenkins World on 14th of September 2016 along with the Blue Ocean, the Declarative pipeline is a new way of how to configure the Pipelines rather than script them.
Docker support in Declarative Pipeline allows you to version your application code, Jenkins Pipeline configuration, and the environment where your pipeline will run, all in a single repository. It’s a crazy powerful combination.
Declarative Pipeline introduces the postBuild
section that makes it easy to run things conditionally at the end of your Pipeline without the complexity of the try... catch of Pipeline script.
pipeline {
agent { docker 'php' }
stages {
stage('build') {
steps {
sh 'php --version'
}
}
}
}
See additional basic examples in another language.
Blue Ocean is a new project that rethinks the user experience of Jenkins. Designed from the ground up for Jenkins Pipeline and compatible with Freestyle jobs, Blue Ocean reduces clutter and increases clarity for every member of your team.
Please refer to the official documentation description for additional configuration and usage of the Jenkins docker image.
- Clone the repo or just the
docker-compose.yml
file. - Go to that folder and run
docker-compose up -d
.
If you are getting this error (on Docker version 18 and above), please set environment variable COMPOSE_CONVERT_WINDOWS_PATHS
to true.
E.g. In Powershell, you can do: $env:COMPOSE_CONVERT_WINDOWS_PATHS=1
.
See docker/compose#4240 issue for more info.
- Prepare Jenkins to shutdown (Manage Jenkins > Prepare for Shutdown).
- Go to your
docker-compose.yml
folder. - Run
docker-compose up -d
again to recreate the container with new image and run it as a daemon.
You can also run the image without any cloning by using the docker run
command.
docker run -d --name my_jenkins -v /your/home/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 --group-add docker 616slayer616/jenkins
Please alter the /your/home/jenkins_home
path to your needs.
docker run -d --name my_jenkins -v /C/Users/<your-profile>/Documents/docker/jenkins/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 --group-add docker 616slayer616/jenkins