forked from carlossg/jenkins-swarm-slave-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
23 lines (16 loc) · 902 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM openjdk:8u162-jdk
MAINTAINER Carlos Sanchez <[email protected]>
ENV JENKINS_SWARM_VERSION 3.12
ENV JENKINS_SWARM_DOWNLOAD_SITE https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client
ENV JENKINS_HOME /home/jenkins-slave
ENV JENKINS_USER jenkins-slave
# install netstat to allow connection health check with
# netstat -tan | grep ESTABLISHED
RUN apt-get update && apt-get install -y net-tools && rm -rf /var/lib/apt/lists/*
RUN useradd -c "Jenkins Slave user" -d "${JENKINS_HOME}" -U -s /sbin/nologin -m "${JENKINS_USER}"
RUN curl --create-dirs -sSLo /usr/share/jenkins/swarm-client-${JENKINS_SWARM_VERSION}.jar \
${JENKINS_SWARM_DOWNLOAD_SITE}/${JENKINS_SWARM_VERSION}/swarm-client-${JENKINS_SWARM_VERSION}.jar \
&& chmod 755 /usr/share/jenkins
COPY jenkins-slave.sh /usr/local/bin/jenkins-slave.sh
USER "${JENKINS_USER}"
ENTRYPOINT ["/usr/local/bin/jenkins-slave.sh"]