-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
23 lines (19 loc) · 1.06 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
# This Dockerfile is used to build an image containing basic stuff to be used as a Jenkins slave build node.
# It is based on instructions from https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin and Dockerfile
# from https://hub.docker.com/r/evarga/jenkins-slave/
FROM centos:latest
MAINTAINER Stefan Lehmann <[email protected]>
# Install a basic SSH server GIT, UNZIP, LSOF and JDK 8
RUN yum install -y openssh-server git unzip lsof java-1.8.0-openjdk-headless && yum clean all
# update sshd settings, create jenkins user, set jenkins user pw, generate ssh keys
RUN sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd \
&& mkdir -p /var/run/sshd \
&& useradd -u 1000 -m -s /bin/bash jenkins \
&& echo "jenkins:jenkins" | chpasswd \
&& /usr/bin/ssh-keygen -A \
&& echo export JAVA_HOME="/`alternatives --display java | grep best | cut -d "/" -f 2-6`" >> /etc/environment
# Set java environment
ENV JAVA_HOME /etc/alternatives/jre
# Standard SSH port
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]