-
Notifications
You must be signed in to change notification settings - Fork 20
/
Dockerfile
132 lines (114 loc) · 3.86 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
FROM centos:7
### user name recognition at runtime w/ an arbitrary uid - for OpenShift deployments
COPY scripts/uid_entrypoint /usr/local/bin/uid_entrypoint
RUN chmod u+x /usr/local/bin/uid_entrypoint && \
chgrp 0 /usr/local/bin/uid_entrypoint && \
chmod g=u /usr/local/bin/uid_entrypoint /etc/passwd
# https://github.com/jenkinsci/remoting/blob/master/CHANGELOG.md
ARG REMOTING_VERSION=3.29
# https://github.com/jenkinsci/docker-jnlp-slave/
ARG JNLP_AGENT_SCRIPT_VERSION=3.29-1
RUN curl --create-dirs -sSLo /usr/share/jenkins/slave.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${REMOTING_VERSION}/remoting-${REMOTING_VERSION}.jar \
&& chmod 755 /usr/share/jenkins \
&& chmod 644 /usr/share/jenkins/slave.jar
ADD https://raw.githubusercontent.com/jenkinsci/docker-jnlp-slave/${JNLP_AGENT_SCRIPT_VERSION}/jenkins-slave /usr/local/bin/jenkins-slave
RUN chmod 555 /usr/local/bin/jenkins-slave && \
chgrp 0 /usr/local/bin/jenkins-slave && \
mkdir -p /home/jenkins/.jenkins && \
mkdir -p /home/jenkins/agent
ENTRYPOINT [ "uid_entrypoint", "jenkins-slave" ]
# Required for python36u
RUN yum install -y yum-utils && \
yum install -y https://centos7.iuscommunity.org/ius-release.rpm
# https://linuxize.com/post/how-to-install-ffmpeg-on-centos-7/
RUN rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
RUN rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
RUN yum update -y \
&& yum install -y \
autoconf \
automake \
blas \
blas-devel \
createrepo \
e2fsprogs-devel \
ffmpeg \
ffmpeg-devel \
git \
graphviz \
gtk3 \
ImageMagick \
ImageMagick-devel \
lapack \
lapack-devel \
libclang \
libgtk-vnc-2.0-0 \
libtool \
libXtst \
mailx \
make \
makeinfo \
mariadb-libs \
metacity \
mutter \
net-snmp-devel.x86_64 \
java-1.8.0-openjdk-devel \
openssl-devel.x86_64 \
patch \
perl \
perl-LDAP \
python-gtk-vnc \
python36u\
rpm-build \
strace \
subversion \
sysstat \
tcl \
tcpdump \
tcsh \
telnet \
tigervnc \
tigervnc-server \
tk \
unrar \
unzip \
vino \
webkitgtk \
webkitgtk3 \
wget \
xmlstarlet \
xorg-x11-apps.x86_64 \
xorg-x11-drv-dummy.x86_64 \
xorg-x11-drv-evdev.x86_64 \
xorg-x11-drv-fbdev.x86_64 \
xorg-x11-drv-keyboard.x86_64 \
xorg-x11-drv-mouse.x86_64 \
xorg-x11-drv-synaptics.x86_64 \
xorg-x11-drv-vmmouse.x86_64 \
xorg-x11-drv-void.x86_64 \
xorg-x11-server-Xvfb.x86_64 \
xterm \
zip \
zsh \
&& yum clean all
RUN ln -s /usr/bin/git /usr/local/bin/git \
&& ln -s /bin/bash /usr/local/bin/hipp_shell
ENV HOME=/home/jenkins
ENV DISPLAY :0
RUN mkdir -p ${HOME}/.vnc && chmod -R 775 ${HOME} \
&& echo "123456" | vncpasswd -f > ${HOME}/.vnc/passwd \
&& chmod 600 ${HOME}/.vnc/passwd
# Create a custom vnc xstartup file
COPY scripts/xstartup_mutter.sh ${HOME}/.vnc/xstartup.sh
RUN chmod 755 ${HOME}/.vnc/xstartup.sh
# explicitly set locale
ENV LANG=en_US.UTF-8
ENV JENKINS_AGENT_WORKDIR=${HOME}/agent
ENV JAVA_OPTS=""
# org.jenkinsci.plugins.gitclient.CliGitAPIImpl.useSETSID=true to allow git client to ssh clone to use passphrase protected keys
ENV JNLP_PROTOCOL_OPTS="-XshowSettings:vm -Xmx256m -Dsun.zip.disableMemoryMapping=true -Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=true -Dorg.jenkinsci.plugins.gitclient.CliGitAPIImpl.useSETSID=true"
ENV JAVA_TOOL_OPTIONS="-XX:+IgnoreUnrecognizedVMOptions -XX:+UseContainerSupport -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
ENV OPENJ9_JAVA_OPTIONS="-XX:+IgnoreUnrecognizedVMOptions -XX:+UseContainerSupport -XX:+IdleTuningCompactOnIdle -XX:+IdleTuningGcOnIdle -XX:MaxRAMPercentage=64"
ENV IBM_JAVA_OPTIONS="-XX:+IgnoreUnrecognizedVMOptions -XX:+UseContainerSupport -XX:+IdleTuningCompactOnIdle -XX:+IdleTuningGcOnIdle -XX:MaxRAMPercentage=64"
ENV _JAVA_OPTIONS="-XX:MaxRAMPercentage=64.0"
WORKDIR /home/jenkins
USER 10001:0