| Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame^] | 1 | # Official Jenkins Docker image |
| Michael Neale | 2dedbdb | 2014-07-09 16:58:10 +1000 | [diff] [blame] | 2 | |
| Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame^] | 3 | The Jenkins Continuous Integration and Delivery server. |
| Michael Neale | 711e12e | 2014-07-16 11:02:46 +1000 | [diff] [blame] | 4 | |
| Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame^] | 5 | This is a fully functional Jenkins server, based on the Long Term Support release |
| 6 | http://jenkins-ci.org/ |
| Michael Neale | 711e12e | 2014-07-16 11:02:46 +1000 | [diff] [blame] | 7 | |
| Michael Neale | 71eb3ab | 2014-07-09 18:04:01 +1000 | [diff] [blame] | 8 | |
| Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame^] | 9 | |
| 10 | # Usage |
| Michael Neale | 71eb3ab | 2014-07-09 18:04:01 +1000 | [diff] [blame] | 11 | |
| 12 | ``` |
| Michael Neale | 709841c | 2014-07-14 12:16:58 +1000 | [diff] [blame] | 13 | docker run -p 8080:8080 jenkins |
| Michael Neale | 71eb3ab | 2014-07-09 18:04:01 +1000 | [diff] [blame] | 14 | ``` |
| 15 | |
| Michael Neale | 711e12e | 2014-07-16 11:02:46 +1000 | [diff] [blame] | 16 | 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 a persistent volume: |
| Michael Neale | 71eb3ab | 2014-07-09 18:04:01 +1000 | [diff] [blame] | 17 | |
| 18 | ``` |
| Michael Neale | 709841c | 2014-07-14 12:16:58 +1000 | [diff] [blame] | 19 | docker run --name myjenkins -p 8080:8080 -v /var/jenkins_home jenkins |
| Michael Neale | 71eb3ab | 2014-07-09 18:04:01 +1000 | [diff] [blame] | 20 | ``` |
| 21 | |
| Michael Neale | 709841c | 2014-07-14 12:16:58 +1000 | [diff] [blame] | 22 | The volume for the "myjenkins" named container will then be persistent. |
| 23 | |
| 24 | You can also bind mount in a volume from the host: |
| 25 | |
| Michael Neale | 709841c | 2014-07-14 12:16:58 +1000 | [diff] [blame] | 26 | First, ensure that /your/home is accessible by the jenkins user in container (jenkins user - uid 102 normally - or use -u root), then: |
| Michael Neale | 71eb3ab | 2014-07-09 18:04:01 +1000 | [diff] [blame] | 27 | |
| 28 | ``` |
| Michael Neale | 709841c | 2014-07-14 12:16:58 +1000 | [diff] [blame] | 29 | docker run -p 8080:8080 -v /your/home:/var/jenkins_home jenkins |
| Michael Neale | 71eb3ab | 2014-07-09 18:04:01 +1000 | [diff] [blame] | 30 | ``` |
| 31 | |
| Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame^] | 32 | ## Backing up data |
| 33 | |
| 34 | If you bind mount in a volume - you can simply back up that directory (which is jenkins_home) at any time. |
| 35 | |
| 36 | If your volume is inside a container - you can use ```docker cp $ID:/var/jenkins_home``` command to extract the data. |
| 37 | |
| 38 | # Attaching build executors |
| 39 | |
| 40 | You 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. |
| 41 | |
| 42 | |
| 43 | # Upgrading |
| 44 | |
| 45 | All 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. |
| 46 | |
| Michael Neale | 709841c | 2014-07-14 12:16:58 +1000 | [diff] [blame] | 47 | |
| 48 | |