Docs

Jenkins Docker image

Usage

Simple invocation:

docker run -d --publish 8080:8080 cgswong/jenkins

The volume /var/lib/jenkins stores plugins, data and configuration. This can be mounted for further customization and/or data backup.You will probably want to make that a persistent volume (recommended):

Backing up data

Treat the /var/lib/jenkins directory as you would a database, i.e. make sure you do backups to keep your important data safe. You can use docker cp $PWD:/var/lib/jenkins to extract the data.

Attaching build executors

You can run builds on the master (out of the box) but if you want to attach build slave servers: make sure you map the port --publish 50000:50000 which will be used when you connect a slave agent. A good example Docker build container is Maestrodev, it has lots of good tools installed.

Passing parameters

You might need to customize the JVM running Jenkins, typically to pass system properties or tweak heap memory settings. Just pass these as parameters on the command line per normal: