forked from openshift/jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.rhel7
102 lines (91 loc) · 5.51 KB
/
Dockerfile.rhel7
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
FROM registry.access.redhat.com/rhel7
# Jenkins image for OpenShift
#
# This image provides a Jenkins server, primarily intended for integration with
# OpenShift v3.
#
# Volumes:
# * /var/jenkins_home
# Environment:
# * $JENKINS_PASSWORD - Password for the Jenkins 'admin' user.
MAINTAINER Ben Parees <[email protected]>
ENV JENKINS_VERSION=1.651.2 \
HOME=/var/lib/jenkins \
JENKINS_HOME=/var/lib/jenkins \
STI_SCRIPTS_URL=image:///usr/libexec/s2i
LABEL io.k8s.description="Jenkins is a continuous integration server" \
io.k8s.display-name="Jenkins 1.651.2" \
io.openshift.tags="jenkins,jenkins1,ci" \
io.openshift.expose-services="8080:http" \
io.openshift.s2i.scripts-url=image:///usr/libexec/s2i
# Labels consumed by Red Hat build service
LABEL com.redhat.component="openshift-jenkins-docker" \
name="openshift3/jenkins-1-rhel7" \
version="3.6" \
architecture="x86_64" \
release="22"
# 8080 for main web interface, 50000 for slave agents
EXPOSE 8080 50000
RUN yum-config-manager --disable epel >/dev/null || : && \
yum-config-manager --enable rhel-7-server-ose-3.3-rpms || : && \
INSTALL_PKGS="rsync gettext git tar zip unzip java-1.8.0-openjdk java-1.8.0-openjdk.i686 java-1.8.0-openjdk-devel java-1.8.0-openjdk-devel.i686 atomic-openshift-clients jenkins-1.651.2 jenkins-plugin-kubernetes jenkins-plugin-openshift-pipeline jenkins-plugin-openshift-login jenkins-plugin-credentials jenkins-plugin-ace-editor jenkins-plugin-branch-api jenkins-plugin-cloudbees-folder jenkins-plugin-durable-task jenkins-plugin-git jenkins-plugin-git-client jenkins-plugin-git-server jenkins-plugin-handlebars jenkins-plugin-jquery-detached jenkins-plugin-mapdb-api jenkins-plugin-matrix-project jenkins-plugin-mercurial jenkins-plugin-momentjs jenkins-plugin-multiple-scms jenkins-plugin-pipeline-build-step jenkins-plugin-pipeline-graph-analysis jenkins-plugin-pipeline-input-step jenkins-plugin-pipeline-rest-api jenkins-plugin-pipeline-stage-step jenkins-plugin-pipeline-stage-view jenkins-plugin-pipeline-utility-steps jenkins-plugin-plain-credentials jenkins-plugin-scm-api jenkins-plugin-script-security jenkins-plugin-ssh-credentials jenkins-plugin-structs jenkins-plugin-subversion jenkins-plugin-workflow-aggregator-2.1-1.el7.x86_64 jenkins-plugin-workflow-api jenkins-plugin-workflow-basic-steps jenkins-plugin-workflow-cps jenkins-plugin-workflow-cps-global-lib jenkins-plugin-workflow-durable-task-step jenkins-plugin-workflow-job jenkins-plugin-workflow-multibranch jenkins-plugin-workflow-remote-loader jenkins-plugin-workflow-scm-step jenkins-plugin-workflow-step-api jenkins-plugin-workflow-step-api jenkins-plugin-workflow-support jenkins-plugin-openshift-sync" && \
yum install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all && \
localedef -f UTF-8 -i en_US en_US.UTF-8
COPY ./contrib/openshift /opt/openshift
COPY ./contrib/jenkins /usr/local/bin
ADD ./contrib/s2i /usr/libexec/s2i
# Remove the base-plugins.txt file because it's only used for Centos
# and its presence in the rhel image is confusing.
RUN rm /opt/openshift/base-plugins.txt && \
mkdir -p /opt/openshift/plugins && \
# NOTE: When adding new Jenkins plugin, you have to create the symlink for the
# HPI file created by rpm to /opt/openshift/plugins folder.
# need to create <plugin>.pinned files when upgrading "core" plugins like credentials or subversion that are bundled with the jenkins server
for FILENAME in /usr/lib64/jenkins/*hpi ; do ln -s $FILENAME /opt/openshift/plugins/`basename $FILENAME .hpi`.jpi; done &&\
touch /opt/openshift/plugins/credentials.jpi.pinned && \
touch /opt/openshift/plugins/subversion.jpi.pinned && \
touch /opt/openshift/plugins/ssh-credentials.jpi.pinned && \
touch /opt/openshift/plugins/script-security.jpi.pinned && \
touch /opt/openshift/plugins/matrix-project.jpi.pinned && \
rmdir /var/log/jenkins && \
chmod 775 /etc/passwd && \
chmod -R 775 /etc/alternatives && \
chmod -R 775 /var/lib/alternatives && \
chmod -R 775 /usr/lib/jvm && \
chmod 775 /usr/bin && \
chmod 775 /usr/lib/jvm-exports && \
chmod 775 /usr/share/man/man1 && \
unlink /usr/bin/java && \
unlink /usr/bin/jjs && \
unlink /usr/bin/keytool && \
unlink /usr/bin/orbd && \
unlink /usr/bin/pack200 && \
unlink /usr/bin/policytool && \
unlink /usr/bin/rmid && \
unlink /usr/bin/rmiregistry && \
unlink /usr/bin/servertool && \
unlink /usr/bin/tnameserv && \
unlink /usr/bin/unpack200 && \
unlink /usr/lib/jvm-exports/jre && \
unlink /usr/share/man/man1/java.1.gz && \
unlink /usr/share/man/man1/jjs.1.gz && \
unlink /usr/share/man/man1/keytool.1.gz && \
unlink /usr/share/man/man1/orbd.1.gz && \
unlink /usr/share/man/man1/pack200.1.gz && \
unlink /usr/share/man/man1/policytool.1.gz && \
unlink /usr/share/man/man1/rmid.1.gz && \
unlink /usr/share/man/man1/rmiregistry.1.gz && \
unlink /usr/share/man/man1/servertool.1.gz && \
unlink /usr/share/man/man1/tnameserv.1.gz && \
unlink /usr/share/man/man1/unpack200.1.gz && \
/usr/local/bin/fix-permissions /opt/openshift && \
chown -R 1001:0 /opt/openshift && \
# the prior chown doesn't traverse the /opt/openshift/plugins links .. this one will assist fix-permission/assemble for extension builds like master/slave
chown 1001:0 /usr/lib64/jenkins/*hpi && \
/usr/local/bin/fix-permissions /var/lib/jenkins && \
/usr/local/bin/fix-permissions /var/log
VOLUME ["/var/lib/jenkins"]
USER 1001
CMD ["/usr/libexec/s2i/run"]