23 lines
1.2 KiB
Docker
23 lines
1.2 KiB
Docker
# Official Jenkins LTS image plus what the controller executor needs to run the
|
|
# pipeline: python3 for the tests and the pinned plugin lockfile.
|
|
FROM eclipse-temurin:21.0.13.1_2-jdk-jammy@sha256:4b3d0998ee65462bd86ff060c87119b3575294cb3d0927372afa6f3708b0c8db AS patched_java
|
|
FROM jenkins/jenkins:2.580.1-lts-jdk21@sha256:a660310e39ade10631f774bacd5219de767dfd08947ea5c32a739b5e5bb382c1
|
|
|
|
USER root
|
|
RUN rm -rf /opt/java/openjdk
|
|
COPY --from=patched_java /opt/java/openjdk /opt/java/openjdk
|
|
ENV JAVA_VERSION=jdk-21.0.13.1+2
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends python3 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
USER jenkins
|
|
|
|
# ponytail: curl + sha256sum instead of jenkins-plugin-cli, which needs >128 MiB heap
|
|
# just to parse the update-center JSON on a 512 MB droplet.
|
|
COPY plugins.txt /tmp/plugins.txt
|
|
RUN mkdir -p /usr/share/jenkins/ref/plugins && cd /usr/share/jenkins/ref/plugins \
|
|
&& tr -d '\r' < /tmp/plugins.txt | grep -Ev '^(#|$)' | while IFS=: read -r name ver sha; do \
|
|
curl -fsSL -o "$name.jpi" "https://updates.jenkins.io/download/plugins/$name/$ver/$name.hpi" \
|
|
&& echo "$sha $name.jpi" | sha256sum -c --quiet || exit 1; \
|
|
done
|