blob: 7241039899121992920fadd9f0f90fcc76d17f26 [file] [log] [blame]
Nicolas De Loof05080682014-10-01 10:50:33 +02001#FROM java:openjdk-7u65-jdk
2FROM java:7u65
Michael Neale2627b962014-07-21 15:52:23 +10003
Tianon Gravic9c889b2014-09-29 11:37:09 -06004RUN apt-get update && apt-get install -y wget git curl zip && rm -rf /var/lib/apt/lists/*
Michael Neale2627b962014-07-21 15:52:23 +10005
Nicolas De Loof57d92432014-10-02 08:59:04 +02006ENV JENKINS_VERSION 1.565.3
Nicolas De Loof070a1ce2014-10-01 11:22:32 +02007RUN mkdir /usr/share/jenkins/
8RUN useradd -d /home/jenkins -m -s /bin/bash jenkins
Nicolas De Loof1a4ae4d2014-10-02 08:21:14 +02009RUN 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 -060010
Michael Neale9be25dd2014-07-09 18:47:57 +100011ENV JENKINS_HOME /var/jenkins_home
Tianon Gravic9c889b2014-09-29 11:37:09 -060012RUN usermod -m -d "$JENKINS_HOME" jenkins && chown -R jenkins "$JENKINS_HOME"
13VOLUME /var/jenkins_home
14
15COPY init.groovy /tmp/WEB-INF/init.groovy
16RUN cd /tmp && zip -g /usr/share/jenkins/jenkins.war WEB-INF/init.groovy && rm -rf /tmp/WEB-INF
Michael Neale3e124ed2014-07-18 15:12:27 +100017
Vincent Dupain1ac0bcd2014-08-18 15:06:43 +020018# define url prefix for running jenkins behind Apache (https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache)
19ENV JENKINS_PREFIX /
20
Nicolas De Loof28d0c592014-10-01 15:07:26 +020021# override JAVA_OPTS using `docker run --env` to pass custom JVM parameters, typically `-D...` system properties
22ENV JAVA_OPTS ""
23
Michael Neale3e124ed2014-07-18 15:12:27 +100024# for main web interface:
Michael Nealefe683742014-09-26 20:49:30 +100025EXPOSE 8080
Michael Neale3e124ed2014-07-18 15:12:27 +100026
27# will be used by attached slave agents:
Michael Nealefe683742014-09-26 20:49:30 +100028EXPOSE 50000
Michael Neale2627b962014-07-21 15:52:23 +100029
Tianon Gravic9c889b2014-09-29 11:37:09 -060030USER jenkins
Nicolas De Loof28d0c592014-10-01 15:07:26 +020031
32ENTRYPOINT java $JAVA_OPTS -jar /usr/share/jenkins/jenkins.war --prefix=$JENKINS_PREFIX