blob: cb2d7ef703ea38efa452ef247615d77f2e612846 [file] [log] [blame]
Nicolas De Loof05080682014-10-01 10:50:33 +02001#FROM java:openjdk-7u65-jdk
2FROM java:7u65
Michael Neale2627b962014-07-21 15:52:23 +10003
Tianon Gravic9c889b2014-09-29 11:37:09 -06004RUN apt-get update && apt-get install -y wget git curl zip && rm -rf /var/lib/apt/lists/*
Michael Neale2627b962014-07-21 15:52:23 +10005
Tianon Gravic9c889b2014-09-29 11:37:09 -06006# 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
8RUN 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 Neale640f91d2014-07-09 18:56:29 +100010
Tianon Gravic9c889b2014-09-29 11:37:09 -060011RUN echo deb http://pkg.jenkins-ci.org/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list
12
13ENV JENKINS_VERSION 1.565.2
14
15RUN apt-get update && apt-get install -y jenkins="${JENKINS_VERSION}" && rm -rf /var/lib/apt/lists/*
16
Michael Neale9be25dd2014-07-09 18:47:57 +100017ENV JENKINS_HOME /var/jenkins_home
Tianon Gravic9c889b2014-09-29 11:37:09 -060018RUN usermod -m -d "$JENKINS_HOME" jenkins && chown -R jenkins "$JENKINS_HOME"
19VOLUME /var/jenkins_home
20
21COPY init.groovy /tmp/WEB-INF/init.groovy
22RUN cd /tmp && zip -g /usr/share/jenkins/jenkins.war WEB-INF/init.groovy && rm -rf /tmp/WEB-INF
Michael Neale3e124ed2014-07-18 15:12:27 +100023
Vincent Dupain1ac0bcd2014-08-18 15:06:43 +020024# define url prefix for running jenkins behind Apache (https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache)
25ENV JENKINS_PREFIX /
26
Michael Neale3e124ed2014-07-18 15:12:27 +100027# for main web interface:
Michael Nealefe683742014-09-26 20:49:30 +100028EXPOSE 8080
Michael Neale3e124ed2014-07-18 15:12:27 +100029
30# will be used by attached slave agents:
Michael Nealefe683742014-09-26 20:49:30 +100031EXPOSE 50000
Michael Neale2627b962014-07-21 15:52:23 +100032
Tianon Gravic9c889b2014-09-29 11:37:09 -060033COPY ./jenkins.sh /usr/local/bin/jenkins.sh
34USER jenkins
Vincent Dupain1ac0bcd2014-08-18 15:06:43 +020035CMD ["/usr/local/bin/jenkins.sh"]