forked from tehranian/dind-jenkins-slave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (31 loc) · 1.28 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
# Docker-in-Docker Jenkins Slave
#
# See: https://github.com/tehranian/dind-jenkins-slave
# See: TODO(dan) - link to blog post
#
# Following the best practices outlined in:
# http://jonathan.bergknoff.com/journal/building-good-docker-images
FROM evarga/jenkins-slave
RUN apt-get update && apt-get install -y curl wget
# Install Docker from Docker Inc. repositories.
RUN curl -sSL https://get.docker.com/ | sh && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y docker-engine && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN curl -s -L https://github.com/docker/compose/releases/latest | \
egrep -o '/docker/compose/releases/download/[0-9.]*/docker-compose-Linux-x86_64' | \
wget --base=http://github.com/ -i - -O /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose && \
/usr/local/bin/docker-compose --version
ENV LOG=file
ADD wrapdocker /usr/local/bin/wrapdocker
RUN chmod +x /usr/local/bin/wrapdocker
VOLUME /var/lib/docker
# Make sure that the "jenkins" user from evarga's image is part of the "docker"
# group. Needed to access the docker daemon's unix socket.
RUN usermod -a -G docker jenkins
# place the jenkins slave startup script into the container
ADD jenkins-slave-startup.sh /
CMD ["/jenkins-slave-startup.sh"]