forked from bibinwilson/jenkins-docker-slave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.openjdk11
66 lines (53 loc) · 1.93 KB
/
Dockerfile.openjdk11
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM ubuntu:18.04
LABEL maintainer="[email protected]"
# Set timezone for debian tzdata with script
# Thanks: https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image/949998
# https://serverfault.com/users/293588/romeo-ninov
ADD ./timezone.sh /timezone.sh
RUN chmod +x /timezone.sh && \
/timezone.sh
# Install openJDK11 from repo
RUN apt-get install -y --no-install-recommends \
openjdk-11-jdk-headless \
openjdk-11-jre-headless
# Install curl and git
RUN apt-get install -y --no-install-recommends \
curl \
git \
gnupg
# Install OpenSSH server
RUN apt-get install -y --no-install-recommends \
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
# Add Mono from the mono project
# Directions from: https://www.mono-project.com/download/stable/#download-lin
# 11/2019: key not found in hkp://keyserver.ubuntu.com:80
# https://github.com/mono/mono/issues/9891
RUN curl https://download.mono-project.com/repo/xamarin.gpg | apt-key add - && \
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | tee /etc/apt/sources.list.d/mono-official-stable.list && \
apt update -y && \
apt-get update -y
# Install Mono and nuget
RUN apt install -y --no-install-recommends \
mono-complete \
nuget
# Update nuget
RUN nuget update -self
# Cleanup old packages
RUN apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
# Add user jenkins to the image
RUN adduser --quiet jenkins &&\
# Set password for the jenkins user (chpasswd format username:cleartext_pw)
echo "jenkins:jenkins" | chpasswd
# Copy settings
#ADD settings.xml /home/jenkins/
# Copy authorized keys
ADD ssh/authorized_keys /home/jenkins/.ssh/authorized_keys
# Set that .ssh
RUN chown -R jenkins:jenkins /home/jenkins/.ssh/
# Standard SSH port
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]