blob: 8962d156120df025118ca10cc843063e9f10ab12 [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
Nicolas De Loof42c1dd92015-07-07 10:49:25 +020024ENV JENKINS_VERSION 1.619
25# curl http://repo.jenkins-ci.org/simple/releases/org/jenkins-ci/main/jenkins-war/1.619/jenkins-war-${JENKINS_VERSION}.war.sha1
26ENV JENKINS_SHA 2fce08aaba46cde57398fa484069ab6b95520b7e
Nicolas De Loofb75dc1a2015-03-17 11:24:05 +010027
28# could use ADD but this one does not check Last-Modified header
29# see https://github.com/docker/docker/issues/8331
Nicolas De Loof129a9702015-06-26 11:32:38 +020030RUN curl -fL http://mirrors.jenkins-ci.org/war/$JENKINS_VERSION/jenkins.war -o /usr/share/jenkins/jenkins.war \
Kengo TODAb56f2912015-04-19 11:57:43 +080031 && echo "$JENKINS_SHA /usr/share/jenkins/jenkins.war" | sha1sum -c -
Nicolas De Loofb75dc1a2015-03-17 11:24:05 +010032
33ENV JENKINS_UC https://updates.jenkins-ci.org
34RUN chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref
35
36# for main web interface:
37EXPOSE 8080
38
39# will be used by attached slave agents:
40EXPOSE 50000
41
Carlos Sanchezc8c95d12015-07-02 12:36:13 +020042ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log
Jesse Glick8cdfb1f2015-04-28 09:32:11 -040043
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