Michael Neale | 93ac93b | 2014-07-09 16:52:21 +1000 | [diff] [blame] | 1 | FROM ubuntu:14.04 |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 2 | |
Michael Neale | 5e655bf | 2014-09-26 09:22:01 +1000 | [diff] [blame] | 3 | RUN echo "1.565.2" > .lts-version-number |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 4 | |
Carlos Sanchez | 19c878e | 2014-09-10 11:14:32 +0200 | [diff] [blame] | 5 | RUN apt-get update && apt-get install -y wget git curl zip && apt-get clean |
Michael Neale | fe68374 | 2014-09-26 20:49:30 +1000 | [diff] [blame^] | 6 | RUN apt-get update && apt-get install -y --no-install-recommends openjdk-7-jdk && apt-get clean bash |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 7 | |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 8 | RUN wget -q -O - http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key | sudo apt-key add - |
| 9 | RUN echo deb http://pkg.jenkins-ci.org/debian-stable binary/ >> /etc/apt/sources.list |
Michael Neale | ddcb7cc | 2014-07-14 12:01:49 +1000 | [diff] [blame] | 10 | RUN apt-get update && apt-get install -y jenkins |
NĂ©stor Salceda | 6d12089 | 2014-08-28 12:23:04 +0200 | [diff] [blame] | 11 | RUN usermod -m -d /var/jenkins_home jenkins |
Michael Neale | 640f91d | 2014-07-09 18:56:29 +1000 | [diff] [blame] | 12 | RUN mkdir -p /var/jenkins_home && chown -R jenkins /var/jenkins_home |
Michael Neale | 57de5eb | 2014-07-15 19:41:30 +1000 | [diff] [blame] | 13 | ADD init.groovy /tmp/WEB-INF/init.groovy |
Carlos Sanchez | 19c878e | 2014-09-10 11:14:32 +0200 | [diff] [blame] | 14 | RUN cd /tmp && zip -g /usr/share/jenkins/jenkins.war WEB-INF/init.groovy && rm -rf /tmp/WEB-INF |
Vincent Dupain | 1ac0bcd | 2014-08-18 15:06:43 +0200 | [diff] [blame] | 15 | ADD ./jenkins.sh /usr/local/bin/jenkins.sh |
| 16 | RUN chmod +x /usr/local/bin/jenkins.sh |
Michael Neale | 640f91d | 2014-07-09 18:56:29 +1000 | [diff] [blame] | 17 | USER jenkins |
| 18 | |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 19 | # VOLUME /var/jenkins_home - bind this in via -v if you want to make this persistent. |
Michael Neale | 9be25dd | 2014-07-09 18:47:57 +1000 | [diff] [blame] | 20 | ENV JENKINS_HOME /var/jenkins_home |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 21 | |
Vincent Dupain | 1ac0bcd | 2014-08-18 15:06:43 +0200 | [diff] [blame] | 22 | # define url prefix for running jenkins behind Apache (https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache) |
| 23 | ENV JENKINS_PREFIX / |
| 24 | |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 25 | # for main web interface: |
Michael Neale | fe68374 | 2014-09-26 20:49:30 +1000 | [diff] [blame^] | 26 | EXPOSE 8080 |
Michael Neale | 3e124ed | 2014-07-18 15:12:27 +1000 | [diff] [blame] | 27 | |
| 28 | # will be used by attached slave agents: |
Michael Neale | fe68374 | 2014-09-26 20:49:30 +1000 | [diff] [blame^] | 29 | EXPOSE 50000 |
Michael Neale | 2627b96 | 2014-07-21 15:52:23 +1000 | [diff] [blame] | 30 | |
Vincent Dupain | 1ac0bcd | 2014-08-18 15:06:43 +0200 | [diff] [blame] | 31 | CMD ["/usr/local/bin/jenkins.sh"] |