Nicolas De Loof | 0508068 | 2014-10-01 10:50:33 +0200 | [diff] [blame] | 1 | #FROM java:openjdk-7u65-jdk |
| 2 | FROM java:7u65 |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 3 | |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 4 | 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] | 5 | |
Nicolas De Loof | 57d9243 | 2014-10-02 08:59:04 +0200 | [diff] [blame^] | 6 | ENV JENKINS_VERSION 1.565.3 |
Nicolas De Loof | 070a1ce | 2014-10-01 11:22:32 +0200 | [diff] [blame] | 7 | RUN mkdir /usr/share/jenkins/ |
| 8 | RUN useradd -d /home/jenkins -m -s /bin/bash jenkins |
Nicolas De Loof | 1a4ae4d | 2014-10-02 08:21:14 +0200 | [diff] [blame] | 9 | 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] | 10 | |
Michael Neale | 9be25dd | 2014-07-09 18:47:57 +1000 | [diff] [blame] | 11 | ENV JENKINS_HOME /var/jenkins_home |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 12 | RUN usermod -m -d "$JENKINS_HOME" jenkins && chown -R jenkins "$JENKINS_HOME" |
| 13 | VOLUME /var/jenkins_home |
| 14 | |
| 15 | COPY init.groovy /tmp/WEB-INF/init.groovy |
| 16 | RUN cd /tmp && zip -g /usr/share/jenkins/jenkins.war WEB-INF/init.groovy && rm -rf /tmp/WEB-INF |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 17 | |
Vincent Dupain | 1ac0bcd | 2014-08-18 15:06:43 +0200 | [diff] [blame] | 18 | # define url prefix for running jenkins behind Apache (https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache) |
| 19 | ENV JENKINS_PREFIX / |
| 20 | |
Nicolas De Loof | 28d0c59 | 2014-10-01 15:07:26 +0200 | [diff] [blame] | 21 | # override JAVA_OPTS using `docker run --env` to pass custom JVM parameters, typically `-D...` system properties |
| 22 | ENV JAVA_OPTS "" |
| 23 | |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 24 | # for main web interface: |
Michael Neale | fe68374 | 2014-09-26 20:49:30 +1000 | [diff] [blame] | 25 | EXPOSE 8080 |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 26 | |
| 27 | # will be used by attached slave agents: |
Michael Neale | fe68374 | 2014-09-26 20:49:30 +1000 | [diff] [blame] | 28 | EXPOSE 50000 |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 29 | |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 30 | USER jenkins |
Nicolas De Loof | 28d0c59 | 2014-10-01 15:07:26 +0200 | [diff] [blame] | 31 | |
| 32 | ENTRYPOINT java $JAVA_OPTS -jar /usr/share/jenkins/jenkins.war --prefix=$JENKINS_PREFIX |