blob: e8daf99516d5963af98933dd8a41f083d9268187 [file] [log] [blame] [view]
Michael Neale3e124ed2014-07-18 15:12:27 +10001# Official Jenkins Docker image
Michael Neale2dedbdb2014-07-09 16:58:10 +10002
Michael Neale3e124ed2014-07-18 15:12:27 +10003The Jenkins Continuous Integration and Delivery server.
Michael Neale711e12e2014-07-16 11:02:46 +10004
Michael Neale3e124ed2014-07-18 15:12:27 +10005This is a fully functional Jenkins server, based on the Long Term Support release
6http://jenkins-ci.org/
Michael Neale711e12e2014-07-16 11:02:46 +10007
Michael Neale71eb3ab2014-07-09 18:04:01 +10008
Michael Neale00190fb2014-07-18 15:17:18 +10009<img src="http://jenkins-ci.org/sites/default/files/jenkins_logo.png"/>
10
Michael Neale3e124ed2014-07-18 15:12:27 +100011
12# Usage
Michael Neale71eb3ab2014-07-09 18:04:01 +100013
14```
Michael Neale709841c2014-07-14 12:16:58 +100015docker run -p 8080:8080 jenkins
Michael Neale71eb3ab2014-07-09 18:04:01 +100016```
17
Michael Neale711e12e2014-07-16 11:02:46 +100018This 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 a persistent volume:
Michael Neale71eb3ab2014-07-09 18:04:01 +100019
20```
Michael Neale709841c2014-07-14 12:16:58 +100021docker run --name myjenkins -p 8080:8080 -v /var/jenkins_home jenkins
Michael Neale71eb3ab2014-07-09 18:04:01 +100022```
23
Michael Neale709841c2014-07-14 12:16:58 +100024The volume for the "myjenkins" named container will then be persistent.
25
26You can also bind mount in a volume from the host:
27
Michael Neale709841c2014-07-14 12:16:58 +100028First, ensure that /your/home is accessible by the jenkins user in container (jenkins user - uid 102 normally - or use -u root), then:
Michael Neale71eb3ab2014-07-09 18:04:01 +100029
30```
Michael Neale709841c2014-07-14 12:16:58 +100031docker run -p 8080:8080 -v /your/home:/var/jenkins_home jenkins
Michael Neale71eb3ab2014-07-09 18:04:01 +100032```
33
Michael Neale3e124ed2014-07-18 15:12:27 +100034## Backing up data
35
36If you bind mount in a volume - you can simply back up that directory (which is jenkins_home) at any time.
37
38If your volume is inside a container - you can use ```docker cp $ID:/var/jenkins_home``` command to extract the data.
39
40# Attaching build executors
41
42You can run builds on the master (out of the box) buf if you want to attach build slave servers: make sure you map the port: ```-p 50000:50000``` - which will be used when you connect a slave agent.
43
44
45# Upgrading
46
47All the data needed is in the /var/jenkins_home directory - so depending on how you manage that - depends on how you upgrade. Generally - you can copy it out - and then "docker pull" the image again - and you will have the latest LTS - you can then start up with -v pointing to that data (/var/jenkins_home) and everything will be as you left it.
48
Michael Neale709841c2014-07-14 12:16:58 +100049
50