Nicolas De loof | 11e9eb7 | 2014-10-09 11:14:00 +0200 | [diff] [blame] | 1 | FROM java:openjdk-7u65-jdk |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 2 | |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 3 | RUN apt-get update && apt-get install -y wget git curl zip && rm -rf /var/lib/apt/lists/* |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 4 | |
Nicolas De Loof | 57d9243 | 2014-10-02 08:59:04 +0200 | [diff] [blame] | 5 | ENV JENKINS_VERSION 1.565.3 |
Nicolas De Loof | 79dc46d | 2014-11-28 10:16:36 +0100 | [diff] [blame^] | 6 | ENV JENKINS_HOME /var/jenkins_home |
Nicolas De Loof | acb8649 | 2014-10-24 13:43:13 +0200 | [diff] [blame] | 7 | |
| 8 | # `/usr/share/jenkins/ref/` contains all reference configuraiton we want to set on a fresh new installation |
| 9 | # use it to bundle additional plugins or config file with your custom jenkins Docker image. |
| 10 | RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d |
| 11 | |
Nicolas De Loof | 3d78499 | 2014-11-28 10:15:15 +0100 | [diff] [blame] | 12 | # Jenkins is ran with user `jenkins`, uid = 1000 |
| 13 | # If you bind mount a volume from host/vloume from a data container, |
| 14 | # ensure you use same uid |
Nicolas De Loof | 79dc46d | 2014-11-28 10:16:36 +0100 | [diff] [blame^] | 15 | RUN useradd -d "$JENKINS_HOME" -u 1000 -m -s /bin/bash jenkins |
Carlos Sanchez | c223beb | 2014-10-02 11:06:30 +0200 | [diff] [blame] | 16 | |
Nicolas De Loof | acb8649 | 2014-10-24 13:43:13 +0200 | [diff] [blame] | 17 | COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-angent-port.groovy |
| 18 | |
| 19 | # could use ADD but this one does not check Last-Modified header - see https://github.com/docker/docker/issues/8331 |
| 20 | RUN curl -L http://mirrors.jenkins-ci.org/war-stable/$JENKINS_VERSION/jenkins.war -o /usr/share/jenkins/jenkins.war |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 21 | |
Nicolas De Loof | acb8649 | 2014-10-24 13:43:13 +0200 | [diff] [blame] | 22 | ENV JENKINS_UC https://updates.jenkins-ci.org |
Nicolas De Loof | 79dc46d | 2014-11-28 10:16:36 +0100 | [diff] [blame^] | 23 | RUN chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 24 | VOLUME /var/jenkins_home |
| 25 | |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 26 | # for main web interface: |
Michael Neale | fe68374 | 2014-09-26 20:49:30 +1000 | [diff] [blame] | 27 | EXPOSE 8080 |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 28 | |
| 29 | # will be used by attached slave agents: |
Michael Neale | fe68374 | 2014-09-26 20:49:30 +1000 | [diff] [blame] | 30 | EXPOSE 50000 |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 31 | |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 32 | USER jenkins |
Nicolas De Loof | 28d0c59 | 2014-10-01 15:07:26 +0200 | [diff] [blame] | 33 | |
Nicolas De Loof | d606438 | 2014-10-04 08:17:28 +0200 | [diff] [blame] | 34 | COPY jenkins.sh /usr/local/bin/jenkins.sh |
| 35 | ENTRYPOINT ["/usr/local/bin/jenkins.sh"] |
Nicolas De Loof | acb8649 | 2014-10-24 13:43:13 +0200 | [diff] [blame] | 36 | |
| 37 | # from a derived Dockerfile, can use `RUN plugin.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle |
| 38 | COPY plugins.sh /usr/local/bin/plugins.sh |