blob: 7c612e5f1c3930c102899642d53726998071565e [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 Loof79dc46d2014-11-28 10:16:36 +01005ENV JENKINS_HOME /var/jenkins_home
Nicolas De Loofacb86492014-10-24 13:43:13 +02006
Nicolas De Loof3d784992014-11-28 10:15:15 +01007# Jenkins is ran with user `jenkins`, uid = 1000
8# If you bind mount a volume from host/vloume from a data container,
9# ensure you use same uid
Nicolas De Loof79dc46d2014-11-28 10:16:36 +010010RUN useradd -d "$JENKINS_HOME" -u 1000 -m -s /bin/bash jenkins
Carlos Sanchezc223beb2014-10-02 11:06:30 +020011
Nicolas De Loof9a366622014-11-28 10:19:40 +010012# Jenkins home directoy is a volume, so configuration and build history
13# can be persisted and survive image upgrades
14VOLUME /var/jenkins_home
15
16# `/usr/share/jenkins/ref/` contains all reference configuration we want
17# to set on a fresh new installation. Use it to bundle additional plugins
18# or config file with your custom jenkins Docker image.
19RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d
20
21
Nicolas De Loofacb86492014-10-24 13:43:13 +020022COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-angent-port.groovy
23
Nicolas De Loof58826312014-11-28 10:52:05 +010024ENV JENKINS_VERSION %%JENKINS_VERSION%%
Nicolas De Loof572587c2014-11-28 10:20:11 +010025
Nicolas De Loof9a366622014-11-28 10:19:40 +010026# could use ADD but this one does not check Last-Modified header
27# see https://github.com/docker/docker/issues/8331
Nicolas De Loof40c3e3f2014-12-02 17:19:06 +010028RUN curl -L %%DOWNLOAD_URL%% -o /usr/share/jenkins/jenkins.war
Tianon Gravic9c889b2014-09-29 11:37:09 -060029
Nicolas De Loofacb86492014-10-24 13:43:13 +020030ENV JENKINS_UC https://updates.jenkins-ci.org
Nicolas De Loof79dc46d2014-11-28 10:16:36 +010031RUN chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref
Tianon Gravic9c889b2014-09-29 11:37:09 -060032
Michael Neale3e124ed2014-07-18 15:12:27 +100033# for main web interface:
Michael Nealefe683742014-09-26 20:49:30 +100034EXPOSE 8080
Michael Neale3e124ed2014-07-18 15:12:27 +100035
36# will be used by attached slave agents:
Michael Nealefe683742014-09-26 20:49:30 +100037EXPOSE 50000
Michael Neale2627b962014-07-21 15:52:23 +100038
Tianon Gravic9c889b2014-09-29 11:37:09 -060039USER jenkins
Nicolas De Loof28d0c592014-10-01 15:07:26 +020040
Nicolas De Loofd6064382014-10-04 08:17:28 +020041COPY jenkins.sh /usr/local/bin/jenkins.sh
42ENTRYPOINT ["/usr/local/bin/jenkins.sh"]
Nicolas De Loofacb86492014-10-24 13:43:13 +020043
44# from a derived Dockerfile, can use `RUN plugin.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle
45COPY plugins.sh /usr/local/bin/plugins.sh