forked from sttts/jenkins-slave
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
32 lines (22 loc) · 960 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
32
# This Dockerfile is used to build an image containing basic stuff to be used as a Jenkins slave build node.
FROM ubuntu:14.04
MAINTAINER shayashibara <[email protected]>
RUN apt-get update
# Install a basic SSH server
RUN apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd
# Install JDK 7 (latest edition)
RUN apt-get install -y --no-install-recommends default-jdk
# Install utilities
RUN apt-get install -y git wget curl python-virtualenv python-pip build-essential python-dev
# Add user jenkins to the image
RUN adduser --quiet jenkins
# Add user jenkins to sudoers with NOPASSWD
RUN echo "jenkins ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Set password for the jenkins user (you may want to alter this).
RUN echo "jenkins:jenkins" | chpasswd
# Setting for sshd
RUN sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd
# Standard SSH port
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]