blob: 64071dbe3d6bd14cdaf04b6aff59ef082c9e2652 [file] [log] [blame]
Carlos Sanchez19562542015-04-22 11:36:17 -07001FROM java:8u45-jdk
Nicolas De Loofb75dc1a2015-03-17 11:24:05 +01002
3RUN apt-get update && apt-get install -y wget git curl zip && rm -rf /var/lib/apt/lists/*
4
5ENV JENKINS_HOME /var/jenkins_home
6
7# 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
10RUN useradd -d "$JENKINS_HOME" -u 1000 -m -s /bin/bash jenkins
11
12# 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
Jesse Glickfc9e7102015-04-28 09:37:28 -040022COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy
Nicolas De Loofb75dc1a2015-03-17 11:24:05 +010023
Mark Waiteda842e42015-05-30 07:04:57 -060024ENV JENKINS_VERSION 1.609.1
25ENV JENKINS_SHA 698284ad950bd663c783e99bc8045ca1c9f92159
Nicolas De Loofb75dc1a2015-03-17 11:24:05 +010026
27# could use ADD but this one does not check Last-Modified header
28# see https://github.com/docker/docker/issues/8331
Mike Dillon1f9d73c2015-04-06 17:17:40 -070029RUN curl -fL http://mirrors.jenkins-ci.org/war-stable/$JENKINS_VERSION/jenkins.war -o /usr/share/jenkins/jenkins.war \
Kengo TODAb56f2912015-04-19 11:57:43 +080030 && echo "$JENKINS_SHA /usr/share/jenkins/jenkins.war" | sha1sum -c -
Nicolas De Loofb75dc1a2015-03-17 11:24:05 +010031
32ENV JENKINS_UC https://updates.jenkins-ci.org
33RUN chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref
34
35# for main web interface:
36EXPOSE 8080
37
38# will be used by attached slave agents:
39EXPOSE 50000
40
Jesse Glick8cdfb1f2015-04-28 09:32:11 -040041ENV COPY_REFERENCE_FILE_LOG /var/log/copy_reference_file.log
42RUN touch $COPY_REFERENCE_FILE_LOG && chown jenkins.jenkins $COPY_REFERENCE_FILE_LOG
43
Nicolas De Loofb75dc1a2015-03-17 11:24:05 +010044USER jenkins
45
46COPY jenkins.sh /usr/local/bin/jenkins.sh
47ENTRYPOINT ["/usr/local/bin/jenkins.sh"]
48
49# from a derived Dockerfile, can use `RUN plugin.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle
50COPY plugins.sh /usr/local/bin/plugins.sh