forked from Sjlver/jenkins-slave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (36 loc) · 1.26 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# A Jenkins slave, ready to run with the dslabci.epfl.ch
# To use this, run it as
# $ docker.io run -d -P sjlver/jenkins-slave
# $ docker.io ps -a
# Note the port. Add a Jenkins slave with that hostname and port.
FROM ubuntu:trusty
MAINTAINER Jonas Wagner <[email protected]>
# Set the env variables to non-interactive
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical
# Make sure the package repository is up to date.
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
RUN apt-get install -y --no-install-recommends openjdk-7-jdk
# Add user jenkins to the image
RUN adduser --disabled-password jenkins
# Allow SSH login for the jenkins user
ADD jenkins/ssh /home/jenkins/.ssh
# Git/Mercurial configuration
ADD jenkins/gitconfig /home/jenkins/.gitconfig
ADD jenkins/hgrc /home/jenkins/.hgrc
# Allow sudo for the jenkins user
ADD etc/sudoers.d/jenkins /etc/sudoers.d/jenkins
# Fix owners and permissions
RUN chown -R jenkins:jenkins /home/jenkins
RUN chown -R root:root /etc/sudoers.d
RUN chmod 700 /home/jenkins/.ssh
RUN chmod 600 /home/jenkins/.ssh/authorized_keys
RUN chmod 600 /etc/sudoers.d/jenkins
# Expose SSH port
EXPOSE 22
# Run SSH; that's all :)
CMD /usr/sbin/sshd -D