-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsDockerfile
39 lines (25 loc) · 1019 Bytes
/
JenkinsDockerfile
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
From jenkins/jenkins:lts
USER root
RUN apt-get update && apt-get install -y wget
RUN apt update -y
RUN apt install apt-transport-https ca-certificates curl gnupg lsb-release -y
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt update -y
RUN apt -y install docker-ce docker-ce-cli containerd.io
RUN usermod -aG docker jenkins
COPY start_docker.sh /usr/local/bin/start_docker.sh
RUN chmod +x /usr/local/bin/start_docker.sh
RUN sh -c /usr/local/bin/start_docker.sh
EXPOSE 8080
EXPOSE 50000
USER jenkins
ENTRYPOINT ["java", "-jar", "/usr/share/jenkins/jenkins.war"]
start_docker.sh
================
#!/bin/bash
#Start Docker Service
service docker start
#Continue running Jenkins
exec "$@"