/jenkins

jenkins docker image for szewec

Primary LanguageDockerfile

Supported tags and respective Dockerfile links

Jenkins

The Jenkins Continuous Integration and Delivery server.

This is a fully functional Jenkins server, based on the Long Term Support release. http://jenkins.io/.

Jenkins CI

Usage

docker run -p 8080:8080 -p 50000:50000 szewec/jenkins

NOTE: read below the build executors part for the role of the 50000 port mapping.

This will store the workspace in /var/jenkins_home. All Jenkins data lives in there - including plugins and configuration. You will probably want to make that an explicit volume so you can manage it and attach to another container for upgrades :

docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home szewec/jenkins

this will automatically create a 'jenkins_home' volume on docker host, that will survive container stop/restart/deletion.

Avoid using a bind mount from a folder on host into /var/jenkins_home, as this might result in file permission issue. If you really need to bind mount jenkins_home, ensure that directory on host is accessible by the jenkins user in container (jenkins user - uid 1000) or use -u some_other_user parameter with docker run.

Backing up data

If you bind mount in a volume - you can simply back up that directory (which is jenkins_home) at any time.

This is highly recommended. Treat the jenkins_home directory as you would a database - in Docker you would generally put a database on a volume.

If your volume is inside a container - you can use docker cp $ID:/var/jenkins_home command to extract the data, or other options to find where the volume data is. Note that some symlinks on some OSes may be converted to copies (this can confuse jenkins with lastStableBuild links etc)

For more info check Docker docs section on Managing data in containers