forked from M3hran/docker-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
45 lines (34 loc) · 1.41 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
FROM m3hran/baseimage:latest
MAINTAINER Martin Taheri <[email protected]>
LABEL Description="Jenkins CI Image"
ENV JENKINS_HOME /jenkins
ENV JENKINS_LOGS /var/log/jenkins
# Install required jenkins and docker packages
RUN clean_install.sh default-jdk apt-transport-https ca-certificates software-properties-common \
make
# Install docker apt repo
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Install docker
RUN clean_install.sh docker-ce
# Install docker-compose
RUN curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-Linux-x86_64 \
-o /usr/local/bin/docker-compose
RUN chmod +x /usr/local/bin/docker-compose
# Set JAVA_HOME
RUN echo JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java" >> /etc/environment
# Install Jenkins
RUN wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | apt-key add -
RUN echo deb http://pkg.jenkins.io/debian-stable binary/ | tee /etc/apt/sources.list.d/jenkins.list
RUN clean_install.sh jenkins
RUN mkdir $JENKINS_HOME
RUN chown jenkins: $JENKINS_HOME $JENKINS_LOGS
# Ensure Jenkins service startups
COPY ./resources/jenkins_start.sh /etc/my_init.d/
COPY ./resources/jenkins.default /etc/default/jenkins
RUN chmod +x /etc/my_init.d/jenkins_start.sh
EXPOSE 8080
WORKDIR $JENKINS_HOME