Skip to content

Commit b1b6489

Browse files
authored
Create Jenkins-docker-slave dockerfile
1 parent f2ec28d commit b1b6489

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM ubuntu:18.04
2+
3+
4+
# Make sure the package repository is up to date.
5+
RUN apt-get update && \
6+
apt-get -qy full-upgrade && \
7+
apt-get install -qy git && \
8+
# Install a basic SSH server
9+
apt-get install -qy openssh-server && \
10+
sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd && \
11+
mkdir -p /var/run/sshd && \
12+
# Install JDK 8 (latest stable edition at 2019-04-01)
13+
apt-get install -qy openjdk-8-jdk && \
14+
# Install maven
15+
apt-get install -qy maven && \
16+
# Cleanup old packages
17+
apt-get -qy autoremove && \
18+
# Add user jenkins to the image
19+
adduser --quiet jenkins && \
20+
# Set password for the jenkins user (you may want to alter this).
21+
echo "jenkins:jenkins" | chpasswd && \
22+
mkdir /home/jenkins/.m2
23+
24+
#ADD settings.xml /home/jenkins/.m2/
25+
# Copy authorized keys
26+
COPY .ssh/authorized_keys /home/jenkins/.ssh/authorized_keys
27+
28+
RUN chown -R jenkins:jenkins /home/jenkins/.m2/ && \
29+
chown -R jenkins:jenkins /home/jenkins/.ssh/
30+
31+
# Standard SSH port
32+
EXPOSE 22
33+
34+
CMD ["/usr/sbin/sshd", "-D"]

0 commit comments

Comments
 (0)