-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·64 lines (48 loc) · 1.54 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
FROM nuagebec/alpine-jdk
MAINTAINER Michael Faille "michael@faille.io"
# Environment Variables
ENV JENKINS_VERSION 1.642.2
ENV JENKINS_HOME /var/lib/jenkins
ENV JENKINS_SHARE /usr/share/jenkins
ENV JENKINS_SLAVE_AGENT_PORT 50000
ENV JENKINS_UC https://updates.jenkins-ci.org
ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log
RUN apk update
RUN apk --no-cache add \
gnupg \
tar \
ruby \
git \
zip \
curl \
wget \
bash \
fontconfig \
ttf-dejavu
# Add jenkins user
RUN addgroup jenkins && \
adduser -h $JENKINS_HOME -D -s /bin/bash -G jenkins jenkins
# Setup directories and rights so Jenkins user can do things without sudo
COPY systemconfig.sh /tmp/systemconfig.sh
RUN bash -c /tmp/systemconfig.sh
# Pull LTS version of Jenkins listed above
RUN curl -fL http://mirrors.jenkins-ci.org/war-stable/$JENKINS_VERSION/jenkins.war -o $JENKINS_SHARE/jenkins.war
# Setup plugin update command
COPY plugins.sh /usr/local/bin/plugins
# Volumes
VOLUME $JENKINS_HOME
# for main web interface:
EXPOSE 8080
# will be used by attached slave agents:
EXPOSE 50000
## Downgrade user to install the rest
USER jenkins
# Copy additional files needed from repo into container
COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy
COPY jenkins.sh /usr/local/bin/jenkins
# Install a plugins using script above
WORKDIR $JENKINS_HOME
COPY plugins.txt $JENKINS_SHARE/plugins.txt
RUN /usr/local/bin/plugins $JENKINS_SHARE/plugins.txt
# RUN ls -la $JENKINS_SHARE/ref
ENTRYPOINT ["/usr/local/bin/jenkins"]