-
Notifications
You must be signed in to change notification settings - Fork 7
/
CentOS7Slim.Dockerfile
34 lines (28 loc) · 1.03 KB
/
CentOS7Slim.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
# Arguments allowed to be used in FROM have to come
# before the first stage
ARG DEVELOPMENT_IMAGE_VERSION=0.9
FROM ghcr.io/mantidproject/mantid-development-centos7-slim:${DEVELOPMENT_IMAGE_VERSION}
# Install dependencies
RUN yum install -y \
java-1.8.0-openjdk && \
rm -rf /tmp/* /var/tmp/*
# Setup Jenkins agent
ARG JENKINS_AGENT_VERSION=4.14
RUN mkdir -p /jenkins_workdir && \
chmod o+rw /jenkins_workdir && \
curl \
--location \
--create-dirs \
--output /usr/share/jenkins/agent.jar \
"https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${JENKINS_AGENT_VERSION}/remoting-${JENKINS_AGENT_VERSION}.jar" && \
chmod 755 /usr/share/jenkins && \
chmod 644 /usr/share/jenkins/agent.jar
# Define the working directory of the agent
ENV AGENT_WORKDIR=/jenkins_workdir
# Startup script to run on container launch
COPY jenkins_agent /usr/share/jenkins/agent.sh
# Allow mounting as a volume
VOLUME ["/jenkins_workdir"]
# Set ownership and launch
ADD entrypoint.d/* /etc/entrypoint.d/
CMD ["/usr/share/jenkins/agent.sh"]