-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathDockerfile
31 lines (26 loc) · 965 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
24
25
26
27
28
29
30
31
FROM ubuntu:18.04
# Make sure the package repository is up to date.
RUN apt-get update && \
apt-get install -qy git && \
# Install a basic SSH server
apt-get install -qy openssh-server && \
sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd && \
mkdir -p /var/run/sshd && \
# Install JDK 11
apt-get install -qy default-jdk && \
# Install maven
apt-get install -qy maven && \
# Cleanup old packages
apt-get -qy autoremove && \
# Add user jenkins to the image
adduser --quiet jenkins && \
# Set password for the jenkins user (you may want to alter this).
echo "jenkins:password" | chpasswd && \
mkdir /home/jenkins/.m2
# Copy authorized keys
COPY .ssh/authorized_keys /home/jenkins/.ssh/authorized_keys
RUN chown -R jenkins:jenkins /home/jenkins/.m2/ && \
chown -R jenkins:jenkins /home/jenkins/.ssh/
# Standard SSH port
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]