-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
31 lines (25 loc) · 1.01 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
FROM jenkins/jenkins:lts-slim
# If necessary, update it to your host's GID
ARG DOCKER_GROUP=999
USER root
# Installs the official Docker client
RUN apt-get update && apt-get install -y lsb-release
RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc \
https://download.docker.com/linux/debian/gpg
RUN echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
> /etc/apt/sources.list.d/docker.list
RUN apt-get update && \
apt-get install -y docker-ce-cli && \
groupadd -g $DOCKER_GROUP docker && \
usermod -aG dialout,docker jenkins
# Performs JCasC
ENV JAVA_OPTS=-Djenkins.install.runSetupWizard=false
ENV CASC_JENKINS_CONFIG=/var/jenkins_home/jcasc.yaml
COPY jcasc.yaml /var/jenkins_home/jcasc.yaml
# Install plugins
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.txt
# Defaults to the `jenkins` user
USER jenkins