blob: 00b6ecd75096c98eb11f60431a57a21f2404ed3a [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 Loofacb86492014-10-24 13:43:13 +02006
7# `/usr/share/jenkins/ref/` contains all reference configuraiton we want to set on a fresh new installation
8# use it to bundle additional plugins or config file with your custom jenkins Docker image.
9RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d
10
Nicolas De Loof3d784992014-11-28 10:15:15 +010011# Jenkins is ran with user `jenkins`, uid = 1000
12# If you bind mount a volume from host/vloume from a data container,
13# ensure you use same uid
14RUN useradd -d /home/jenkins -m -u 1000 -s /bin/bash jenkins
Carlos Sanchezc223beb2014-10-02 11:06:30 +020015
Nicolas De Loofacb86492014-10-24 13:43:13 +020016COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-angent-port.groovy
17
18# could use ADD but this one does not check Last-Modified header - see https://github.com/docker/docker/issues/8331
19RUN 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 -060020
Michael Neale9be25dd2014-07-09 18:47:57 +100021ENV JENKINS_HOME /var/jenkins_home
Nicolas De Loofacb86492014-10-24 13:43:13 +020022ENV JENKINS_UC https://updates.jenkins-ci.org
23RUN usermod -m -d "$JENKINS_HOME" jenkins && chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref
Tianon Gravic9c889b2014-09-29 11:37:09 -060024VOLUME /var/jenkins_home
25
Michael Neale3e124ed2014-07-18 15:12:27 +100026# for main web interface:
Michael Nealefe683742014-09-26 20:49:30 +100027EXPOSE 8080
Michael Neale3e124ed2014-07-18 15:12:27 +100028
29# will be used by attached slave agents:
Michael Nealefe683742014-09-26 20:49:30 +100030EXPOSE 50000
Michael Neale2627b962014-07-21 15:52:23 +100031
Tianon Gravic9c889b2014-09-29 11:37:09 -060032USER jenkins
Nicolas De Loof28d0c592014-10-01 15:07:26 +020033
Nicolas De Loofd6064382014-10-04 08:17:28 +020034COPY jenkins.sh /usr/local/bin/jenkins.sh
35ENTRYPOINT ["/usr/local/bin/jenkins.sh"]
Nicolas De Loofacb86492014-10-24 13:43:13 +020036
37# from a derived Dockerfile, can use `RUN plugin.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle
38COPY plugins.sh /usr/local/bin/plugins.sh