blob: b4319e02ad9be8119fe463c73eaccd6a7f254b08 [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
Tianon Gravic9c889b2014-09-29 11:37:09 -06006ENV JENKINS_VERSION 1.565.2
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
Michael Neale3e124ed2014-07-18 15:12:27 +100021# for main web interface:
Michael Nealefe683742014-09-26 20:49:30 +100022EXPOSE 8080
Michael Neale3e124ed2014-07-18 15:12:27 +100023
24# will be used by attached slave agents:
Michael Nealefe683742014-09-26 20:49:30 +100025EXPOSE 50000
Michael Neale2627b962014-07-21 15:52:23 +100026
Tianon Gravic9c889b2014-09-29 11:37:09 -060027COPY ./jenkins.sh /usr/local/bin/jenkins.sh
28USER jenkins
Vincent Dupain1ac0bcd2014-08-18 15:06:43 +020029CMD ["/usr/local/bin/jenkins.sh"]