1
- FROM ubuntu:18 .04
1
+ FROM ubuntu:19 .04
2
2
ENV DEBIAN_FRONTEND noninteractive
3
3
ENV JAVA_VERSION=8 \
4
4
JAVA_UPDATE=131 \
@@ -22,10 +22,11 @@ RUN apt-get update && apt-get -y install ansible
22
22
# --------------------------------------------
23
23
# ------------ Docker
24
24
# --------------------------------------------
25
+ RUN echo
25
26
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg > docker-public-key && \
26
27
apt-key add docker-public-key && \
27
28
rm docker-public-key
28
- RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge" && \
29
+ RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge test " && \
29
30
apt-get update && apt-get install -y docker-ce
30
31
# --------------------------------------------
31
32
# ------------ Docker Compose
@@ -40,26 +41,14 @@ RUN curl -o /usr/bin/docker-compose -L \
40
41
41
42
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
42
43
43
- # This is the line for the Jenkins prefix to set ... remember
44
+ # This is the line for the Jenkins prefix to set to get access with nginx and a
45
+ # comfortable path like http://<yourhost>/jenins... remember
44
46
# to set the location in the reverse-proxy.conf if you change this
45
47
46
48
ENV JENKINS_OPTS="--webroot=/var/cache/jenkins/war --prefix=/jenkins"
47
49
ENV GIT_SSL_NO_VERIFY=1
48
- # -----------------------------------------------
49
- # install Oracle Java if you want ... and
50
- # remove the line "RUN apt-get install -y openjdk-8-jdk"
51
- # and uncomment the next lines above ... but openjdk is pretty good !
52
- # -----------------------------------------------
53
- # ------------ Download
54
- # ## ENV filename jdk-8u131-linux-x64.tar.gz
55
- # ## ENV downloadlink http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}u${JAVA_UPDATE}-b${JAVA_BUILD}/d54c1d3a095b4ff2b6607d096fa80163/jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz
56
- # ## RUN wget --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" -O /tmp/$filename $downloadlink
57
- # ---- unpack java
58
- # ## ENV UNPACK_DIR=jdk1.8.0_131/
59
- # ## RUN mkdir -p /opt/ && tar -zxf /tmp/$filename -C /opt/ && ln -s /opt/${UNPACK_DIR} /opt/java
60
- # ## ENV JAVA_HOME /opt/java
61
50
# ----------------------------------------
62
- # install Maven
51
+ # Maven
63
52
# ----------------------------------------
64
53
RUN wget --no-verbose -O /tmp/apache-maven-3.5.3.tar.gz \
65
54
http://archive.apache.org/dist/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz
@@ -89,61 +78,43 @@ RUN groupadd -g ${gid} ${group} && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid
89
78
# Jenkins home directory is a volume, so configuration and build history
90
79
# can be persisted and survive image upgrades
91
80
81
+ RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d && mkdir /tmp
82
+
92
83
VOLUME /var/jenkins_home
93
84
94
- # `/usr/share/jenkins/ref/` contains all reference configuration we want
95
- # to set on a fresh new installation. Use it to bundle additional plugins
96
- # or config file with your custom jenkins Docker image.
97
- RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d && mkdir /tmp
98
85
ENV TINI_VERSION 0.18.0
99
86
ENV TINI_SHA eadb9d6e2dc960655481d78a92d2c8bc021861045987ccd3e27c7eae5af0cf33
100
87
# Use tini as subreaper in Docker container to adopt zombie processes
101
88
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static-amd64 -o /bin/tini && chmod +x /bin/tini \
102
89
&& echo "$TINI_SHA /bin/tini" | sha256sum -c -
103
90
104
- COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy
105
-
106
91
# jenkins version being bundled in this docker image
107
- # This is the latest stable version
108
- ARG JENKINS_VERSION
109
- ENV JENKINS_VERSION ${JENKINS_VERSION:-2.125 }
92
+ # This is the latest stable version define in file ../.env
93
+ ARG JENKINS_LTS_VERSION
94
+ RUN echo JENKINS_LTS_VERSION=${JENKINS_LTS_VERSION }
110
95
111
96
# ### jenkins.war checksum, download will be validated using it
112
- ARG JENKINS_SHA=80d9a44198195f70218867086759c108821ca0ce
113
- ARG JENKINS_URL=http://updates.jenkins-ci.org/download/war/${JENKINS_VERSION}/jenkins.war
114
-
115
- # could use ADD but this one does not check Last-Modified header neither does it allow to control checksum
116
- # see https://github.com/docker/docker/issues/8331
117
- # RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" | sha1sum -c -
118
-
119
- RUN wget --no-verbose ${JENKINS_URL} -O /usr/share/jenkins/jenkins.war && \
120
- echo "422ba2120ade4c39e19c1aa63684c5db /usr/share/jenkins/jenkins.war" | md5sum -c
97
+ ARG JENKINS_SHA=1ab9577a29362ae9cb51742d9778b44a5c820a9e
98
+ ARG JENKINS_URL=http://updates.jenkins-ci.org/download/war/${JENKINS_LTS_VERSION}/jenkins.war
99
+ # could use ADD but this one does not check Last-Modified header neither does it allow to control checksum see https://github.com/docker/docker/issues/8331
100
+ RUN echo Download from ${JENKINS_URL} && \
101
+ curl -fL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war && \
102
+ echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" | sha1sum -c -
121
103
122
- # ------------------ Optional local caching of files
123
- # Download jenkins with yout favorite browser and put the war in the current dir.
124
- # COPY jenkins-war-${JENKINS_VERSION:-2.99}.war /usr/share/jenkins/jenkins.war
125
104
# ##### # Copy all Cached plugins ...
126
- # to preLoad all Plugins listed in active-plugins.txt use the command
127
- # ./preDownload.sh $(cat active-plugins.txt)
128
- # this will download all the plugins in th Folder Plugins
129
- # COPY Plugins/* /usr/share/jenkins/ref/plugins/
130
- # ------------------ Optional lokal caching of files end block
105
+ COPY Plugins/${JENKINS_LTS_VERSION}/* /usr/share/jenkins/ref/plugins/
131
106
132
107
ENV JENKINS_UC https://updates.jenkins.io
133
108
ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental
134
109
RUN chown -R ${user} "$JENKINS_HOME" /usr/share/jenkins/ref
135
110
136
111
# for main web interface, reversed-proxied by nginx
137
112
EXPOSE 8080
138
-
139
113
ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log
140
-
141
114
USER ${user}
142
-
143
115
COPY jenkins-support /usr/local/bin/jenkins-support
144
116
COPY jenkins.sh /usr/local/bin/jenkins.sh
145
-
146
- ENV JAVA_OPTIONS="-Djava.awt.headless=true -Dhudson.security.csrf.requestfield=crumb"
117
+ ENV JAVA_OPTIONS="-Djava.awt.headless=true -Dhudson.security.csrf.requestfield=crumb -Djenkins.install.runSetupWizard=false"
147
118
148
119
ENTRYPOINT ["/bin/tini" , "--" , "/usr/local/bin/jenkins.sh" ]
149
120
# -------------------------------------------------------------------------
@@ -154,16 +125,9 @@ ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"]
154
125
# curl -sSL "http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | \
155
126
# perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/ ' | awk -F: '{ print $1 }' | sort'
156
127
# ----------------------------------------------------
157
-
158
- # from a derived Dockerfile, can use `RUN /usr/local/bin/install-plugins.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle
159
-
160
- COPY plugins.sh /usr/local/bin/plugins.sh
161
- COPY install-plugins.sh /usr/local/bin/install-plugins.sh
162
- COPY active-plugins.txt /active-plugins.txt
163
-
164
- RUN /usr/local/bin/plugins.sh active-plugins.txt
165
-
166
- # install-plugins.sh get in trouble with curl maybe better next time in Jenkins ---> RUN /usr/local/bin/install-plugins.sh $(cat active-plugins.txt)
128
+ # Prevent Setup Wizard .. all Plugins copied before
129
+ RUN echo ${JENKINS_LTS_VERSION} > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
130
+ RUN echo ${JENKINS_LTS_VERSION} > /usr/share/jenkins/ref/jenkins.install.InstallUtil.lastExecVersion
167
131
168
132
USER root
169
133
0 commit comments