The area51/jenkins image contains the current Jenkins 2.x application within a self-contained docker image.

Usage

To try jenkins out without worrying about persistence (if the container is restarted it will be a fresh install)

# docker run --name=jenkins --hostname=jenkins area51/jenkins

then find the local IP address:

# docker inspect --format '{{ .NetworkSettings.IPAddress }}' jenkins
172.17.0.4

Then in your browser go to http://172.17.0.4/

An example of launching a new jenkins instance with the jenkins configuration in the directory /home/jenkins of the docker host.

# docker run -d \
       --restart=always \
       --name=jenkins --hostname=jenkins \
       -v /home/jenkins:/opt/jenkins \
       area51/jenkins

Slaves

Although you can run this standalone it's better to use additional slaves in separate containers for your jobs. Not only does it separate the builds from the server it also makes maintenance easier - not only does this follow the advice of Docker in keeping a container for a single purpose, it's easier to destroy a container and restart a fresh one than do that with the jenkins server.

The slaves we provide are:

ImageApplication SupportLanguagesDescription
JenkinsCloudBeesNetBeans
area51/jenkins-slaveYesJava 8Standard Jenkins Slave with Java 8 installed
area51/alpine-devYesYesNoJava 8, CAlpine linux build environment
area51/debian-devYesYesPartialJava 8, CDebian linux build environment
area51/ubuntu-devYesYesYesJava 8, CUbuntu linux build environment
  • Jenkins Slave - you can define a running image as a generic jenkins slave
  • CloudBees support - the image supports dynamic provisioning using the CloudBees docker custom build environment plugin.
  • NetBeans support - the image supports being used as a build slave to NetBeans

Volumes

mount pointcontent
/opt/jenkinsthe directory where jenkins configuration (build jobs, workspaces etc) is placed

Environment Variables

VariableDescription
JENKINS_OPTSOptions to pass to jenkins