-
Notifications
You must be signed in to change notification settings - Fork 247
/
Dockerfile
35 lines (29 loc) · 1.11 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
FROM ubuntu:18.04
LABEL maintainer="Bibin Wilson <[email protected]>"
# Make sure the package repository is up to date.
RUN apt-get update && \
apt-get -qy full-upgrade && \
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 8 (latest stable edition at 2019-04-01)
apt-get install -qy openjdk-8-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:jenkins" | chpasswd && \
mkdir /home/jenkins/.m2
#ADD settings.xml /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"]