1- FROM ubuntu:18 .04
1+ FROM ubuntu:19 .04
22ENV DEBIAN_FRONTEND noninteractive
33ENV JAVA_VERSION=8 \
44 JAVA_UPDATE=131 \
@@ -22,10 +22,11 @@ RUN apt-get update && apt-get -y install ansible
2222# --------------------------------------------
2323# ------------ Docker
2424# --------------------------------------------
25+ RUN echo
2526RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg > docker-public-key && \
2627 apt-key add docker-public-key && \
2728 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 " && \
2930 apt-get update && apt-get install -y docker-ce
3031# --------------------------------------------
3132# ------------ Docker Compose
@@ -40,26 +41,14 @@ RUN curl -o /usr/bin/docker-compose -L \
4041
4142ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
4243
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
4446# to set the location in the reverse-proxy.conf if you change this
4547
4648ENV JENKINS_OPTS="--webroot=/var/cache/jenkins/war --prefix=/jenkins"
4749ENV 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
6150# ----------------------------------------
62- # install Maven
51+ # Maven
6352# ----------------------------------------
6453RUN wget --no-verbose -O /tmp/apache-maven-3.5.3.tar.gz \
6554 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
8978# Jenkins home directory is a volume, so configuration and build history
9079# can be persisted and survive image upgrades
9180
81+ RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d && mkdir /tmp
82+
9283VOLUME /var/jenkins_home
9384
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
9885ENV TINI_VERSION 0.18.0
9986ENV TINI_SHA eadb9d6e2dc960655481d78a92d2c8bc021861045987ccd3e27c7eae5af0cf33
10087# Use tini as subreaper in Docker container to adopt zombie processes
10188RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static-amd64 -o /bin/tini && chmod +x /bin/tini \
10289 && echo "$TINI_SHA /bin/tini" | sha256sum -c -
10390
104- COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy
105-
10691# 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 }
11095
11196# ### 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 -
121103
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
125104# ##### # 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/
131106
132107ENV JENKINS_UC https://updates.jenkins.io
133108ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental
134109RUN chown -R ${user} "$JENKINS_HOME" /usr/share/jenkins/ref
135110
136111# for main web interface, reversed-proxied by nginx
137112EXPOSE 8080
138-
139113ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log
140-
141114USER ${user}
142-
143115COPY jenkins-support /usr/local/bin/jenkins-support
144116COPY 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"
147118
148119ENTRYPOINT ["/bin/tini" , "--" , "/usr/local/bin/jenkins.sh" ]
149120# -------------------------------------------------------------------------
@@ -154,16 +125,9 @@ ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"]
154125# curl -sSL "http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | \
155126# perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/ ' | awk -F: '{ print $1 }' | sort'
156127# ----------------------------------------------------
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
167131
168132USER root
169133
0 commit comments