forked from katosys/jenkins-master
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (56 loc) · 3.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#------------------------------------------------------------------------------
# Set the base image for subsequent instructions:
#------------------------------------------------------------------------------
FROM centos:7
MAINTAINER Giulio <>
#------------------------------------------------------------------------------
# Environment variables:
#------------------------------------------------------------------------------
ENV MESOS_VERSION="0.28.1" \
MESOS_URL="http://repos.mesosphere.io/el/7/noarch/RPMS" \
JENKINS_UC="https://updates.jenkins.io" \
JENKINS_VERSION="2.6-1.1" \
JENKINS_MESOS_VERSION="0.12.0"
#------------------------------------------------------------------------------
# Update the base image:
#------------------------------------------------------------------------------
RUN rpm --import http://mirror.centos.org/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7 \
&& yum update -y && yum clean all
#------------------------------------------------------------------------------
# Install libmesos:
#------------------------------------------------------------------------------
RUN yum install -y ${MESOS_URL}/mesosphere-el-repo-7-3.noarch.rpm \
yum-utils subversion-libs apr-util && mkdir /tmp/mesos && cd /tmp/mesos \
&& yumdownloader mesos-${MESOS_VERSION} && rpm2cpio mesos*.rpm | cpio -idm \
&& cp usr/lib/libmesos-*.so /usr/lib/ && cd /usr/lib \
&& ln -s libmesos-*.so libmesos.so && rm -rf /tmp/mesos && yum clean all
#------------------------------------------------------------------------------
# Install jenkins:
#------------------------------------------------------------------------------
RUN rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key \
&& yum install -y java-1.8.0-openjdk-headless java-1.8.0-openjdk-devel wget openssl \
&& wget -q -O /etc/yum.repos.d/jenkins.repo \
http://pkg.jenkins-ci.org/redhat/jenkins.repo \
&& yum install -y git jenkins-${JENKINS_VERSION} && yum clean all
#------------------------------------------------------------------------------
# Copy plugin dependencies:
#------------------------------------------------------------------------------
COPY plugins.sh /usr/local/bin/plugins.sh
RUN yum install unzip -y && yum clean all
#------------------------------------------------------------------------------
# Populate root file system:
#------------------------------------------------------------------------------
ADD rootfs /
#------------------------------------------------------------------------------
# Install plugins:
#------------------------------------------------------------------------------
RUN mkdir -p /var/lib/jenkins/plugins && cd /var/lib/jenkins/plugins \
&& /usr/local/bin/plugins.sh /var/lib/jenkins/plugins.txt
#------------------------------------------------------------------------------
# Move jenkins dir in staging directory:
#------------------------------------------------------------------------------
RUN mv /var/lib/jenkins /var/lib/jenkins_staging
#------------------------------------------------------------------------------
# Expose ports and entrypoint:
#------------------------------------------------------------------------------
ENTRYPOINT ["/init"]