-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
76 lines (59 loc) · 2.39 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM openjdk:8-jdk
# Jenkins settings
ENV JENKINS_HOME /var/jenkins_home
ENV JENKINS_UC https://updates.jenkins.io
# Docker settings
ENV DOCKER_COMPOSE_VERSION 1.7.1
# Docker prerequisites
RUN apt-get update
RUN apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
lxc \
iptables \
python-setuptools
# Install syslog-stdout
RUN easy_install syslog-stdout supervisor-stdout
# Install Docker from Docker Inc. repositories.
RUN curl -sSL https://get.docker.com/ | sh
# Install Docker Compose
RUN curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
RUN chmod +x /usr/local/bin/docker-compose
# Install the wrapper script from https://raw.githubusercontent.com/docker/docker/master/hack/dind.
ADD ./files/dind /usr/local/bin/dind
RUN chmod +x /usr/local/bin/dind
ADD ./files/wrapdocker /usr/local/bin/wrapdocker
RUN chmod +x /usr/local/bin/wrapdocker
# Install Jenkins
RUN wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
RUN sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
RUN apt-get update && apt-get install -y zip supervisor jenkins && rm -rf /var/lib/apt/lists/*
RUN usermod -a -G docker jenkins
VOLUME /var/jenkins_home
# Get plugins.sh tool from official Jenkins repo, this allows plugin installation
ADD ./files/plugins.sh /usr/local/bin/plugins.sh
RUN chmod +x /usr/local/bin/plugins.sh
ADD ./files/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Install python tools
RUN easy_install pip
COPY ./files/requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
# Copy files onto the filesystem
COPY ./files/docker /
RUN chmod +x /docker-entrypoint /usr/local/bin/*
# Install Node.js v8.x and build tools (including npm)
RUN apt-get update
RUN apt-get install -y sudo
RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash
RUN sudo apt-get install -y nodejs
RUN sudo apt-get install -y build-essential
# Install yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
RUN sudo apt-get update && sudo apt-get install yarn
# Expose Jenkins port
EXPOSE 8080
# Set the entrypoint
ENTRYPOINT ["/docker-entrypoint"]
CMD ["/usr/bin/supervisord"]