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 | |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 6 | # gpg: key D50582E6: public key "Kohsuke Kawaguchi <kk@kohsuke.org>" imported |
| 7 | # see also http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key |
| 8 | RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 150FDE3F7787E7D11EF4E12A9B7D32F2D50582E6 |
| 9 | # from: curl -sSL 'http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key' | docker run -i --rm debian bash -c 'gpg --import && gpg --fingerprint' |
Michael Neale | 640f91d | 2014-07-09 18:56:29 +1000 | [diff] [blame] | 10 | |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 11 | RUN echo deb http://pkg.jenkins-ci.org/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list |
| 12 | |
| 13 | ENV JENKINS_VERSION 1.565.2 |
| 14 | |
| 15 | RUN apt-get update && apt-get install -y jenkins="${JENKINS_VERSION}" && rm -rf /var/lib/apt/lists/* |
| 16 | |
Michael Neale | 9be25dd | 2014-07-09 18:47:57 +1000 | [diff] [blame] | 17 | ENV JENKINS_HOME /var/jenkins_home |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 18 | RUN usermod -m -d "$JENKINS_HOME" jenkins && chown -R jenkins "$JENKINS_HOME" |
| 19 | VOLUME /var/jenkins_home |
| 20 | |
| 21 | COPY init.groovy /tmp/WEB-INF/init.groovy |
| 22 | 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] | 23 | |
Vincent Dupain | 1ac0bcd | 2014-08-18 15:06:43 +0200 | [diff] [blame] | 24 | # define url prefix for running jenkins behind Apache (https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache) |
| 25 | ENV JENKINS_PREFIX / |
| 26 | |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 27 | # for main web interface: |
Michael Neale | fe68374 | 2014-09-26 20:49:30 +1000 | [diff] [blame] | 28 | EXPOSE 8080 |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 29 | |
| 30 | # will be used by attached slave agents: |
Michael Neale | fe68374 | 2014-09-26 20:49:30 +1000 | [diff] [blame] | 31 | EXPOSE 50000 |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 32 | |
Tianon Gravi | c9c889b | 2014-09-29 11:37:09 -0600 | [diff] [blame] | 33 | COPY ./jenkins.sh /usr/local/bin/jenkins.sh |
| 34 | USER jenkins |
Vincent Dupain | 1ac0bcd | 2014-08-18 15:06:43 +0200 | [diff] [blame] | 35 | CMD ["/usr/local/bin/jenkins.sh"] |