-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
44 lines (32 loc) · 2.22 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
FROM jenkins/jenkins:2.303.1@sha256:0431426de0e4e32c6e681e62f7c3a7f57a7d49d30c97cbbd9260da74ae201b65
ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false
COPY plugins-with-dependencies.txt /usr/share/jenkins/ref/plugins-with-dependencies.txt
RUN jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins-with-dependencies.txt --latest false --verbose
USER root
# In order to install Plastic SCM client on debian 11 we need to add debian 10 repositories using workaround
# provided here https://plasticscmsupport.zendesk.com/hc/en-us/articles/360013103159-How-to-Install-Plastic-GUI-in-Ubuntu-19-10-and-later-
RUN echo deb http://deb.debian.org/debian/ buster main>/etc/apt/sources.list.d/buster-oldlibs.list
# Install Plastic SCM client
RUN apt-get update \
&& apt-get install -y apt-transport-https wget --no-install-recommends \
&& echo "deb https://www.plasticscm.com/plasticrepo/stable/debian/ ./" | tee /etc/apt/sources.list.d/plasticscm-stable.list \
&& wget https://www.plasticscm.com/plasticrepo/stable/debian/Release.key --quiet -O - | apt-key add - \
&& apt-get update \
&& apt-get install -y plasticscm-client-core --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create settings folder for Plastic
#
# We're doing it here instead of letting Kubernetes' mounting of secrets create
# the folder. Otherwise, if we let Kubernetes mount individual files into a
# non-existent .plastic4 folder, then Kubernetes will create the folder with
# permissions 755, and uid=0 / gid=jenkins. This means that the Jenkins controller
# (which runs as uid=jenkins) will not be able to create new files in that folder.
# This, in turn results in some `cm` invocations failing, which results in error
# messages like these when triggering a job in a Plasti repo:
# ERROR: Unable to find Jenkinsfiles/build_game_linux_plastic_static.groovy from Plastic
# SCM repository "UE-Jenkins-Game@ue_jenkins_buildsystem@cloud" path "/" smartbranch "/main"
RUN mkdir -m 775 /var/jenkins_home/.plastic4
USER jenkins
# Replace the offical google-compute-engine plugin with a locally-built version
COPY google-compute-engine-plugin/target/google-compute-engine.hpi /usr/share/jenkins/ref/plugins/google-compute-engine.jpi