blob: ed7ec74628dcaa0735ade3f9789b19e05654dd64 [file] [log] [blame]
Nicolas De loof11e9eb72014-10-09 11:14:00 +02001FROM java:openjdk-7u65-jdk
Michael Neale2627b962014-07-21 15:52:23 +10002
Tianon Gravic9c889b2014-09-29 11:37:09 -06003RUN apt-get update && apt-get install -y wget git curl zip && rm -rf /var/lib/apt/lists/*
Michael Neale2627b962014-07-21 15:52:23 +10004
Nicolas De Loof57d92432014-10-02 08:59:04 +02005ENV JENKINS_VERSION 1.565.3
Nicolas De Loof79dc46d2014-11-28 10:16:36 +01006ENV JENKINS_HOME /var/jenkins_home
Nicolas De Loofacb86492014-10-24 13:43:13 +02007
Nicolas De Loof3d784992014-11-28 10:15:15 +01008# Jenkins is ran with user `jenkins`, uid = 1000
9# If you bind mount a volume from host/vloume from a data container,
10# ensure you use same uid
Nicolas De Loof79dc46d2014-11-28 10:16:36 +010011RUN useradd -d "$JENKINS_HOME" -u 1000 -m -s /bin/bash jenkins
Carlos Sanchezc223beb2014-10-02 11:06:30 +020012
Nicolas De Loof9a366622014-11-28 10:19:40 +010013# Jenkins home directoy is a volume, so configuration and build history
14# can be persisted and survive image upgrades
15VOLUME /var/jenkins_home
16
17# `/usr/share/jenkins/ref/` contains all reference configuration we want
18# to set on a fresh new installation. Use it to bundle additional plugins
19# or config file with your custom jenkins Docker image.
20RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d
21
22
Nicolas De Loofacb86492014-10-24 13:43:13 +020023COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-angent-port.groovy
24
Nicolas De Loof9a366622014-11-28 10:19:40 +010025# could use ADD but this one does not check Last-Modified header
26# see https://github.com/docker/docker/issues/8331
Nicolas De Loofacb86492014-10-24 13:43:13 +020027RUN curl -L http://mirrors.jenkins-ci.org/war-stable/$JENKINS_VERSION/jenkins.war -o /usr/share/jenkins/jenkins.war
Tianon Gravic9c889b2014-09-29 11:37:09 -060028
Nicolas De Loofacb86492014-10-24 13:43:13 +020029ENV JENKINS_UC https://updates.jenkins-ci.org
Nicolas De Loof79dc46d2014-11-28 10:16:36 +010030RUN chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref
Tianon Gravic9c889b2014-09-29 11:37:09 -060031
Michael Neale3e124ed2014-07-18 15:12:27 +100032# for main web interface:
Michael Nealefe683742014-09-26 20:49:30 +100033EXPOSE 8080
Michael Neale3e124ed2014-07-18 15:12:27 +100034
35# will be used by attached slave agents:
Michael Nealefe683742014-09-26 20:49:30 +100036EXPOSE 50000
Michael Neale2627b962014-07-21 15:52:23 +100037
Tianon Gravic9c889b2014-09-29 11:37:09 -060038USER jenkins
Nicolas De Loof28d0c592014-10-01 15:07:26 +020039
Nicolas De Loofd6064382014-10-04 08:17:28 +020040COPY jenkins.sh /usr/local/bin/jenkins.sh
41ENTRYPOINT ["/usr/local/bin/jenkins.sh"]
Nicolas De Loofacb86492014-10-24 13:43:13 +020042
43# from a derived Dockerfile, can use `RUN plugin.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle
44COPY plugins.sh /usr/local/bin/plugins.sh