@@ -13,12 +13,21 @@ RUN apt-get install -y openjdk-8-jdk
13
13
# ------------ Tools f Jenkins and apt-get to use SSL Repositorys
14
14
RUN apt-get install -y --no-install-recommends apt-utils git wget curl graphviz \
15
15
apt-transport-https ca-certificates software-properties-common
16
+ # -----------------------------------------------
17
+ # --------------- Ansible
18
+ # -----------------------------------------------
19
+ RUN apt-add-repository ppa:ansible/ansible 2>/dev/null
20
+ RUN apt-get update && apt-get -y install ansible
21
+ # --------------------------------------------
16
22
# ------------ Docker
23
+ # --------------------------------------------
17
24
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg > docker-public-key && apt-key add docker-public-key && rm docker-public-key
18
25
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
19
26
RUN apt-get update && apt-get install -y docker-ce
27
+ # --------------------------------------------
20
28
# ------------ Docker Compose
21
- RUN curl -o /usr/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.15.0/docker-compose-$(uname -s)-$(uname -m)" \
29
+ # --------------------------------------------
30
+ RUN curl -o /usr/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.16.1/docker-compose-$(uname -s)-$(uname -m)" \
22
31
&& chmod +x /usr/bin/docker-compose
23
32
24
33
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
@@ -30,8 +39,7 @@ ENV GIT_SSL_NO_VERIFY=1
30
39
# -----------------------------------------------
31
40
# install Oracle Java if you want ... and
32
41
# remove the line "RUN apt-get install -y openjdk-8-jdk"
33
- # and uncomment the next lines
34
- # above ... but openjdk is pretty good !
42
+ # and uncomment the next lines above ... but openjdk is pretty good !
35
43
# -----------------------------------------------
36
44
# ------------ Download
37
45
# ## ENV filename jdk-8u131-linux-x64.tar.gz
@@ -63,9 +71,7 @@ ARG user=jenkins
63
71
ARG group=jenkins
64
72
ARG uid=1000
65
73
ARG gid=1000
66
- # Jenkins is run with user `jenkins`, uid = 1000
67
- # If you bind mount a volume from the host or a data container,
68
- # ensure you use the same uid
74
+ # Jenkins is run with user `jenkins`, uid = 1000 If you bind mount a volume from the host or a data container, ensure you use the same uid
69
75
RUN groupadd -g ${gid} ${group} && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user}
70
76
# Jenkins home directory is a volume, so configuration and build history
71
77
# can be persisted and survive image upgrades
@@ -85,24 +91,34 @@ RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION
85
91
COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy
86
92
87
93
# jenkins version being bundled in this docker image
94
+ # This is the latest stable version
88
95
ARG JENKINS_VERSION
89
- ENV JENKINS_VERSION ${JENKINS_VERSION:-2.79 }
96
+ ENV JENKINS_VERSION ${JENKINS_VERSION:-2.73.2 }
90
97
91
- # jenkins.war checksum, download will be validated using it
92
- ARG JENKINS_SHA=272e035475837b5e1c4efb84c8b65949e3f658a3
98
+ # ### jenkins.war checksum, download will be validated using it
99
+ ARG JENKINS_SHA=1489e498f682e8b61ce4cf8124de200f264b087c
93
100
94
- # Can be used to customize where jenkins.war get downloaded from http://updates.jenkins-ci.org/download/war/2.79/jenkins.war
95
101
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war
96
102
97
103
# could use ADD but this one does not check Last-Modified header neither does it allow to control checksum
98
104
# see https://github.com/docker/docker/issues/8331
99
105
RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" | sha1sum -c -
100
106
107
+ # ------------------ Optional lokal caching of files
108
+ # Download jenkins with yout favorite browser and put the war in the current dir.
109
+ # COPY jenkins-war-2.73.2.war /usr/share/jenkins/jenkins.war
110
+ # ##### # Copy all Cached plugins ...
111
+ # to preLoad all Plugins listed in active-plugins.txt use the command
112
+ # ./preDownload.sh $(cat active-plugins.txt)
113
+ # this will download all the plugins in th Folder Plugins
114
+ # COPY Plugins/* /usr/share/jenkins/ref/plugins/
115
+ # ------------------ Optional lokal caching of files end block
101
116
102
117
ENV JENKINS_UC https://updates.jenkins.io
118
+ ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental
103
119
RUN chown -R ${user} "$JENKINS_HOME" /usr/share/jenkins/ref
104
120
105
- # for main web interface:
121
+ # for main web interface, reversed-proxied by nginx
106
122
EXPOSE 8080
107
123
108
124
ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log
@@ -115,24 +131,25 @@ COPY jenkins.sh /usr/local/bin/jenkins.sh
115
131
ENV JAVA_OPTIONS="-Djava.awt.headless=true -Dhudson.security.csrf.requestfield=crumb"
116
132
117
133
ENTRYPOINT ["/bin/tini" , "--" , "/usr/local/bin/jenkins.sh" ]
118
- # -----------------------------------------------
119
- # get all Plugins from existing Jenins
120
- # -----------------------------------------------
134
+ # -------------------------------------------------------------------------
135
+ # get all Plugins from existing Jenins without Version (latest is used)
136
+ # --------------------------------------------------------------------------
121
137
# JENKINS_HOST=username:password@myhost.com:port
122
- # curl -sSL "http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/'
138
+ # curl -sSL "http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | \
139
+ # perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/ ' | awk -F: '{ print $1 }' | sort'
140
+ # ----------------------------------------------------
123
141
142
+ # 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
124
143
125
- # ----------------------------------------------------
126
144
COPY plugins.sh /usr/local/bin/plugins.sh
127
145
COPY install-plugins.sh /usr/local/bin/install-plugins.sh
128
- # Install additional plugins
129
- COPY plugins.txt /usr/share/jenkins/ref/
130
- RUN /usr/local/bin/plugins.sh /usr/share/jenkins/ref/plugins.txt
131
-
132
- USER root
146
+ COPY active-plugins.txt /active-plugins.txt
133
147
134
- RUN apt-get clean
148
+ RUN /usr/local/bin/plugins.sh active-plugins.txt
135
149
150
+ # 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)
136
151
152
+ USER root
137
153
154
+ RUN apt-get clean && rm -rf /var/lib/apt/lists/*
138
155
0 commit comments