diff --git a/11/alpine/hotspot/Dockerfile b/11/alpine/hotspot/Dockerfile deleted file mode 100644 index e814b5eabc..0000000000 --- a/11/alpine/hotspot/Dockerfile +++ /dev/null @@ -1,143 +0,0 @@ -ARG ALPINE_TAG=3.19.1 - -FROM alpine:"${ALPINE_TAG}" AS jre-build - -ARG JAVA_VERSION=11.0.23_9 - -SHELL ["/bin/ash", "-o", "pipefail", "-c"] - -COPY jdk-download-url.sh /usr/bin/jdk-download-url.sh -COPY jdk-download.sh /usr/bin/jdk-download.sh -RUN apk add --no-cache \ - ca-certificates \ - curl \ - jq \ - && rm -fr /var/cache/apk/* \ - && /usr/bin/jdk-download.sh alpine - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 11 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-debug \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime - -FROM alpine:"${ALPINE_TAG}" AS controller - -RUN apk add --no-cache \ - bash \ - coreutils \ - curl \ - git \ - git-lfs \ - gnupg \ - musl-locales \ - musl-locales-lang \ - openssh-client \ - tini \ - ttf-dejavu \ - tzdata \ - unzip \ - && git lfs install - -ENV LANG C.UTF-8 - -ARG TARGETARCH -ARG COMMIT_SHA - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=/var/jenkins_home -ARG REF=/usr/share/jenkins/ref - -ENV JENKINS_HOME $JENKINS_HOME -ENV JENKINS_SLAVE_AGENT_PORT ${agent_port} -ENV REF $REF - -# 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 -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && addgroup -g ${gid} ${group} \ - && adduser -h "$JENKINS_HOME" -u ${uid} -G ${group} -s /bin/bash -D ${user} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN mkdir -p ${REF}/init.groovy.d - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION ${JENKINS_VERSION:-2.442} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# 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 -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ - && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -ENV JENKINS_UC https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" - -ARG PLUGIN_CLI_VERSION=2.12.17 -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} - -COPY jenkins-support /usr/local/bin/jenkins-support -COPY jenkins.sh /usr/local/bin/jenkins.sh -COPY jenkins-plugin-cli.sh /bin/jenkins-plugin-cli - -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins.sh"] - -# metadata labels -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Docker image" \ - org.opencontainers.image.description="The Jenkins Continuous Integration and Delivery server" \ - org.opencontainers.image.version="${JENKINS_VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker" \ - org.opencontainers.image.revision="${COMMIT_SHA}" \ - org.opencontainers.image.licenses="MIT" diff --git a/11/debian/bookworm-slim/hotspot/Dockerfile b/11/debian/bookworm-slim/hotspot/Dockerfile deleted file mode 100644 index c74622bf26..0000000000 --- a/11/debian/bookworm-slim/hotspot/Dockerfile +++ /dev/null @@ -1,153 +0,0 @@ -ARG BOOKWORM_TAG=20240423 - -FROM debian:bookworm-"${BOOKWORM_TAG}"-slim as jre-build - -ARG JAVA_VERSION=11.0.23_9 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -COPY jdk-download-url.sh /usr/bin/jdk-download-url.sh -COPY jdk-download.sh /usr/bin/jdk-download.sh - -RUN apt-get update \ - && apt-get install --no-install-recommends -y \ - ca-certificates \ - curl \ - jq \ - && rm -rf /var/lib/apt/lists/* \ - && /usr/bin/jdk-download.sh - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 11 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-debug \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime - -FROM debian:bookworm-"${BOOKWORM_TAG}"-slim AS controller - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - git \ - gnupg \ - gpg \ - libfontconfig1 \ - libfreetype6 \ - procps \ - ssh-client \ - tini \ - unzip \ - tzdata \ - && rm -rf /var/lib/apt/lists/* - -RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh -o /tmp/script.deb.sh \ - && bash /tmp/script.deb.sh \ - && rm -f /tmp/script.deb.sh \ - && apt-get install -y --no-install-recommends \ - git-lfs \ - && rm -rf /var/lib/apt/lists/* \ - && git lfs install - -ENV LANG C.UTF-8 - -ARG TARGETARCH -ARG COMMIT_SHA - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=/var/jenkins_home -ARG REF=/usr/share/jenkins/ref - -ENV JENKINS_HOME $JENKINS_HOME -ENV JENKINS_SLAVE_AGENT_PORT ${agent_port} -ENV REF $REF - -# 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 -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && groupadd -g ${gid} ${group} \ - && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -l -m -s /bin/bash ${user} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN mkdir -p ${REF}/init.groovy.d - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION ${JENKINS_VERSION:-2.442} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# 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 -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ - && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -ENV JENKINS_UC https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" - -ARG PLUGIN_CLI_VERSION=2.12.17 -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} - -COPY jenkins-support /usr/local/bin/jenkins-support -COPY jenkins.sh /usr/local/bin/jenkins.sh -COPY jenkins-plugin-cli.sh /bin/jenkins-plugin-cli - -ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/jenkins.sh"] - -# metadata labels -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Docker image" \ - org.opencontainers.image.description="The Jenkins Continuous Integration and Delivery server" \ - org.opencontainers.image.version="${JENKINS_VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker" \ - org.opencontainers.image.revision="${COMMIT_SHA}" \ - org.opencontainers.image.licenses="MIT" diff --git a/11/debian/bookworm/hotspot/Dockerfile b/11/debian/bookworm/hotspot/Dockerfile deleted file mode 100644 index 3fe53e5efe..0000000000 --- a/11/debian/bookworm/hotspot/Dockerfile +++ /dev/null @@ -1,153 +0,0 @@ -ARG BOOKWORM_TAG=20240423 - -FROM debian:bookworm-"${BOOKWORM_TAG}" as jre-build - -ARG JAVA_VERSION=11.0.23_9 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -COPY jdk-download-url.sh /usr/bin/jdk-download-url.sh -COPY jdk-download.sh /usr/bin/jdk-download.sh - -RUN apt-get update \ - && apt-get install --no-install-recommends -y \ - ca-certificates \ - curl \ - jq \ - && rm -rf /var/lib/apt/lists/* \ - && /usr/bin/jdk-download.sh - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 11 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-debug \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime - -FROM debian:bookworm-"${BOOKWORM_TAG}" AS controller - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - git \ - gnupg \ - gpg \ - libfontconfig1 \ - libfreetype6 \ - procps \ - ssh-client \ - tini \ - unzip \ - tzdata \ - && rm -rf /var/lib/apt/lists/* - -RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh -o /tmp/script.deb.sh \ - && bash /tmp/script.deb.sh \ - && rm -f /tmp/script.deb.sh \ - && apt-get install -y --no-install-recommends \ - git-lfs \ - && rm -rf /var/lib/apt/lists/* \ - && git lfs install - -ENV LANG C.UTF-8 - -ARG TARGETARCH -ARG COMMIT_SHA - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=/var/jenkins_home -ARG REF=/usr/share/jenkins/ref - -ENV JENKINS_HOME $JENKINS_HOME -ENV JENKINS_SLAVE_AGENT_PORT ${agent_port} -ENV REF $REF - -# 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 -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && groupadd -g ${gid} ${group} \ - && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -l -m -s /bin/bash ${user} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN mkdir -p ${REF}/init.groovy.d - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION ${JENKINS_VERSION:-2.442} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# 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 -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ - && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -ENV JENKINS_UC https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" - -ARG PLUGIN_CLI_VERSION=2.12.17 -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} - -COPY jenkins-support /usr/local/bin/jenkins-support -COPY jenkins.sh /usr/local/bin/jenkins.sh -COPY jenkins-plugin-cli.sh /bin/jenkins-plugin-cli - -ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/jenkins.sh"] - -# metadata labels -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Docker image" \ - org.opencontainers.image.description="The Jenkins Continuous Integration and Delivery server" \ - org.opencontainers.image.version="${JENKINS_VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker" \ - org.opencontainers.image.revision="${COMMIT_SHA}" \ - org.opencontainers.image.licenses="MIT" diff --git a/21/alpine/hotspot/Dockerfile b/21/alpine/hotspot/Dockerfile deleted file mode 100644 index 29c1bfd70f..0000000000 --- a/21/alpine/hotspot/Dockerfile +++ /dev/null @@ -1,143 +0,0 @@ -ARG ALPINE_TAG=3.19.1 - -FROM alpine:"${ALPINE_TAG}" AS jre-build - -ARG JAVA_VERSION=21.0.3_9 - -SHELL ["/bin/ash", "-o", "pipefail", "-c"] - -COPY jdk-download-url.sh /usr/bin/jdk-download-url.sh -COPY jdk-download.sh /usr/bin/jdk-download.sh -RUN apk add --no-cache \ - ca-certificates \ - curl \ - jq \ - && rm -fr /var/cache/apk/* \ - && /usr/bin/jdk-download.sh alpine - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 21 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-java-debug-attributes \ - --no-man-pages \ - --no-header-files \ - --compress zip-6 \ - --output /javaruntime - -FROM alpine:"${ALPINE_TAG}" AS controller - -RUN apk add --no-cache \ - bash \ - coreutils \ - curl \ - git \ - git-lfs \ - gnupg \ - musl-locales \ - musl-locales-lang \ - openssh-client \ - tini \ - ttf-dejavu \ - tzdata \ - unzip \ - && git lfs install - -ENV LANG C.UTF-8 - -ARG TARGETARCH -ARG COMMIT_SHA - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=/var/jenkins_home -ARG REF=/usr/share/jenkins/ref - -ENV JENKINS_HOME $JENKINS_HOME -ENV JENKINS_SLAVE_AGENT_PORT ${agent_port} -ENV REF $REF - -# 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 -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && addgroup -g ${gid} ${group} \ - && adduser -h "$JENKINS_HOME" -u ${uid} -G ${group} -s /bin/bash -D ${user} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN mkdir -p ${REF}/init.groovy.d - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION ${JENKINS_VERSION:-2.442} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# 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 -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ - && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -ENV JENKINS_UC https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" - -ARG PLUGIN_CLI_VERSION=2.12.17 -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} - -COPY jenkins-support /usr/local/bin/jenkins-support -COPY jenkins.sh /usr/local/bin/jenkins.sh -COPY jenkins-plugin-cli.sh /bin/jenkins-plugin-cli - -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins.sh"] - -# metadata labels -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Docker image" \ - org.opencontainers.image.description="The Jenkins Continuous Integration and Delivery server" \ - org.opencontainers.image.version="${JENKINS_VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker" \ - org.opencontainers.image.revision="${COMMIT_SHA}" \ - org.opencontainers.image.licenses="MIT" diff --git a/21/debian/bookworm-slim/hotspot/Dockerfile b/21/debian/bookworm-slim/hotspot/Dockerfile deleted file mode 100644 index b05152124e..0000000000 --- a/21/debian/bookworm-slim/hotspot/Dockerfile +++ /dev/null @@ -1,153 +0,0 @@ -ARG BOOKWORM_TAG=20240423 - -FROM debian:bookworm-"${BOOKWORM_TAG}"-slim as jre-build - -ARG JAVA_VERSION=21.0.3_9 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -COPY jdk-download-url.sh /usr/bin/jdk-download-url.sh -COPY jdk-download.sh /usr/bin/jdk-download.sh - -RUN apt-get update \ - && apt-get install --no-install-recommends -y \ - ca-certificates \ - curl \ - jq \ - && rm -rf /var/lib/apt/lists/* \ - && /usr/bin/jdk-download.sh - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 21 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-java-debug-attributes \ - --no-man-pages \ - --no-header-files \ - --compress zip-6 \ - --output /javaruntime - -FROM debian:bookworm-"${BOOKWORM_TAG}"-slim AS controller - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - git \ - gnupg \ - gpg \ - libfontconfig1 \ - libfreetype6 \ - procps \ - ssh-client \ - tini \ - unzip \ - tzdata \ - && rm -rf /var/lib/apt/lists/* - -RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh -o /tmp/script.deb.sh \ - && bash /tmp/script.deb.sh \ - && rm -f /tmp/script.deb.sh \ - && apt-get install -y --no-install-recommends \ - git-lfs \ - && rm -rf /var/lib/apt/lists/* \ - && git lfs install - -ENV LANG C.UTF-8 - -ARG TARGETARCH -ARG COMMIT_SHA - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=/var/jenkins_home -ARG REF=/usr/share/jenkins/ref - -ENV JENKINS_HOME $JENKINS_HOME -ENV JENKINS_SLAVE_AGENT_PORT ${agent_port} -ENV REF $REF - -# 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 -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && groupadd -g ${gid} ${group} \ - && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -l -m -s /bin/bash ${user} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN mkdir -p ${REF}/init.groovy.d - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION ${JENKINS_VERSION:-2.442} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# 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 -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ - && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -ENV JENKINS_UC https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" - -ARG PLUGIN_CLI_VERSION=2.12.17 -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} - -COPY jenkins-support /usr/local/bin/jenkins-support -COPY jenkins.sh /usr/local/bin/jenkins.sh -COPY jenkins-plugin-cli.sh /bin/jenkins-plugin-cli - -ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/jenkins.sh"] - -# metadata labels -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Docker image" \ - org.opencontainers.image.description="The Jenkins Continuous Integration and Delivery server" \ - org.opencontainers.image.version="${JENKINS_VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker" \ - org.opencontainers.image.revision="${COMMIT_SHA}" \ - org.opencontainers.image.licenses="MIT" diff --git a/21/debian/bookworm/hotspot/Dockerfile b/21/debian/bookworm/hotspot/Dockerfile deleted file mode 100644 index c4e9eedee7..0000000000 --- a/21/debian/bookworm/hotspot/Dockerfile +++ /dev/null @@ -1,153 +0,0 @@ -ARG BOOKWORM_TAG=20240423 - -FROM debian:bookworm-"${BOOKWORM_TAG}" as jre-build - -ARG JAVA_VERSION=21.0.3_9 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -COPY jdk-download-url.sh /usr/bin/jdk-download-url.sh -COPY jdk-download.sh /usr/bin/jdk-download.sh - -RUN apt-get update \ - && apt-get install --no-install-recommends -y \ - ca-certificates \ - curl \ - jq \ - && rm -rf /var/lib/apt/lists/* \ - && /usr/bin/jdk-download.sh - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 21 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-java-debug-attributes \ - --no-man-pages \ - --no-header-files \ - --compress zip-6 \ - --output /javaruntime - -FROM debian:bookworm-"${BOOKWORM_TAG}" AS controller - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - git \ - gnupg \ - gpg \ - libfontconfig1 \ - libfreetype6 \ - procps \ - ssh-client \ - tini \ - unzip \ - tzdata \ - && rm -rf /var/lib/apt/lists/* - -RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh -o /tmp/script.deb.sh \ - && bash /tmp/script.deb.sh \ - && rm -f /tmp/script.deb.sh \ - && apt-get install -y --no-install-recommends \ - git-lfs \ - && rm -rf /var/lib/apt/lists/* \ - && git lfs install - -ENV LANG C.UTF-8 - -ARG TARGETARCH -ARG COMMIT_SHA - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=/var/jenkins_home -ARG REF=/usr/share/jenkins/ref - -ENV JENKINS_HOME $JENKINS_HOME -ENV JENKINS_SLAVE_AGENT_PORT ${agent_port} -ENV REF $REF - -# 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 -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && groupadd -g ${gid} ${group} \ - && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -l -m -s /bin/bash ${user} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN mkdir -p ${REF}/init.groovy.d - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION ${JENKINS_VERSION:-2.442} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# 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 -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ - && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -ENV JENKINS_UC https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" - -ARG PLUGIN_CLI_VERSION=2.12.17 -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} - -COPY jenkins-support /usr/local/bin/jenkins-support -COPY jenkins.sh /usr/local/bin/jenkins.sh -COPY jenkins-plugin-cli.sh /bin/jenkins-plugin-cli - -ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/jenkins.sh"] - -# metadata labels -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Docker image" \ - org.opencontainers.image.description="The Jenkins Continuous Integration and Delivery server" \ - org.opencontainers.image.version="${JENKINS_VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker" \ - org.opencontainers.image.revision="${COMMIT_SHA}" \ - org.opencontainers.image.licenses="MIT" diff --git a/21/rhel/ubi9/hotspot/Dockerfile b/21/rhel/ubi9/hotspot/Dockerfile deleted file mode 100644 index 3ef60a876a..0000000000 --- a/21/rhel/ubi9/hotspot/Dockerfile +++ /dev/null @@ -1,146 +0,0 @@ -FROM registry.access.redhat.com/ubi9/ubi:9.3-1610 as jre-build - -ARG JAVA_VERSION=21.0.3_9 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -COPY jdk-download-url.sh /usr/bin/jdk-download-url.sh -COPY jdk-download.sh /usr/bin/jdk-download.sh - -RUN dnf install --disableplugin=subscription-manager --setopt=install_weak_deps=0 --setopt=tsflags=nodocs --allowerasing -y \ - ca-certificates \ - curl \ - jq \ - && dnf clean --disableplugin=subscription-manager all \ - && /usr/bin/jdk-download.sh - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 21 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-java-debug-attributes \ - --no-man-pages \ - --no-header-files \ - --compress zip-6 \ - --output /javaruntime - -FROM registry.access.redhat.com/ubi9/ubi:9.3-1610 as controller - -ENV LANG C.UTF-8 - -ARG TARGETARCH -ARG COMMIT_SHA - -RUN dnf install --disableplugin=subscription-manager --setopt=install_weak_deps=0 --setopt=tsflags=nodocs -y \ - fontconfig \ - freetype \ - git \ - git-lfs \ - unzip \ - which \ - tzdata \ - && dnf clean --disableplugin=subscription-manager all - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=/var/jenkins_home -ARG REF=/usr/share/jenkins/ref - -ENV JENKINS_HOME $JENKINS_HOME -ENV JENKINS_SLAVE_AGENT_PORT ${agent_port} -ENV REF $REF - -# 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 -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && groupadd -g ${gid} ${group} \ - && useradd -N -d "$JENKINS_HOME" -u ${uid} -g ${gid} -l -m -s /bin/bash ${user} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN mkdir -p ${REF}/init.groovy.d - -# Use tini as subreaper in Docker container to adopt zombie processes -ARG TINI_VERSION=v0.19.0 -COPY tini_pub.gpg "${JENKINS_HOME}/tini_pub.gpg" -RUN curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TARGETARCH}" -o /sbin/tini \ - && curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TARGETARCH}.asc" -o /sbin/tini.asc \ - && gpg --no-tty --import "${JENKINS_HOME}/tini_pub.gpg" \ - && gpg --verify /sbin/tini.asc \ - && rm -rf /sbin/tini.asc /root/.gnupg \ - && chmod +x /sbin/tini - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION ${JENKINS_VERSION:-2.442} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# 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 -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ - && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -ENV JENKINS_UC https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" - -ARG PLUGIN_CLI_VERSION=2.12.17 -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} - -COPY jenkins-support /usr/local/bin/jenkins-support -COPY jenkins.sh /usr/local/bin/jenkins.sh -COPY jenkins-plugin-cli.sh /bin/jenkins-plugin-cli - -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins.sh"] - -# metadata labels -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Docker image" \ - org.opencontainers.image.description="The Jenkins Continuous Integration and Delivery server" \ - org.opencontainers.image.version="${JENKINS_VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker" \ - org.opencontainers.image.revision="${COMMIT_SHA}" \ - org.opencontainers.image.licenses="MIT" diff --git a/11/almalinux/almalinux8/hotspot/Dockerfile b/almalinux/almalinux8/hotspot/Dockerfile similarity index 100% rename from 11/almalinux/almalinux8/hotspot/Dockerfile rename to almalinux/almalinux8/hotspot/Dockerfile diff --git a/17/alpine/hotspot/Dockerfile b/alpine/hotspot/Dockerfile similarity index 87% rename from 17/alpine/hotspot/Dockerfile rename to alpine/hotspot/Dockerfile index 23e4171cfa..8fd6a55483 100644 --- a/17/alpine/hotspot/Dockerfile +++ b/alpine/hotspot/Dockerfile @@ -16,19 +16,26 @@ RUN apk add --no-cache \ && rm -fr /var/cache/apk/* \ && /usr/bin/jdk-download.sh alpine -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH +ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" # Generate smaller java runtime without unneeded files # for now we include the full module path to maintain compatibility # while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 17 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-java-debug-attributes \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime +RUN case "$(jlink --version 2>&1)" in \ + # jlink version 11 has less features than JDK17+ + "11."*) set -- "--strip-debug" "--compress=2" ;; \ + "17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \ + # the compression argument is different for JDK21 + "21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \ + *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ + esac; \ + jlink \ + "$1" \ + "$2" \ + --add-modules ALL-MODULE-PATH \ + --no-man-pages \ + --no-header-files \ + --output /javaruntime FROM alpine:"${ALPINE_TAG}" AS controller diff --git a/17/debian/bookworm-slim/hotspot/Dockerfile b/debian/bookworm-slim/hotspot/Dockerfile similarity index 88% rename from 17/debian/bookworm-slim/hotspot/Dockerfile rename to debian/bookworm-slim/hotspot/Dockerfile index d909b53c77..e972b523d6 100644 --- a/17/debian/bookworm-slim/hotspot/Dockerfile +++ b/debian/bookworm-slim/hotspot/Dockerfile @@ -17,19 +17,26 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && /usr/bin/jdk-download.sh -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH +ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" # Generate smaller java runtime without unneeded files # for now we include the full module path to maintain compatibility # while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 17 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-java-debug-attributes \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime +RUN case "$(jlink --version 2>&1)" in \ + # jlink version 11 has less features than JDK17+ + "11."*) set -- "--strip-debug" "--compress=2" ;; \ + "17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \ + # the compression argument is different for JDK21 + "21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \ + *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ + esac; \ + jlink \ + "$1" \ + "$2" \ + --add-modules ALL-MODULE-PATH \ + --no-man-pages \ + --no-header-files \ + --output /javaruntime FROM debian:bookworm-"${BOOKWORM_TAG}"-slim AS controller diff --git a/17/debian/bookworm/hotspot/Dockerfile b/debian/bookworm/hotspot/Dockerfile similarity index 88% rename from 17/debian/bookworm/hotspot/Dockerfile rename to debian/bookworm/hotspot/Dockerfile index 8989d1c633..66c179ba7a 100644 --- a/17/debian/bookworm/hotspot/Dockerfile +++ b/debian/bookworm/hotspot/Dockerfile @@ -17,19 +17,26 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && /usr/bin/jdk-download.sh -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH +ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" # Generate smaller java runtime without unneeded files # for now we include the full module path to maintain compatibility # while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 17 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-java-debug-attributes \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime +RUN case "$(jlink --version 2>&1)" in \ + # jlink version 11 has less features than JDK17+ + "11."*) set -- "--strip-debug" "--compress=2" ;; \ + "17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \ + # the compression argument is different for JDK21 + "21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \ + *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ + esac; \ + jlink \ + "$1" \ + "$2" \ + --add-modules ALL-MODULE-PATH \ + --no-man-pages \ + --no-header-files \ + --output /javaruntime FROM debian:bookworm-"${BOOKWORM_TAG}" AS controller diff --git a/docker-bake.hcl b/docker-bake.hcl index a1df11b645..5601908119 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -137,7 +137,7 @@ function "tag_lts" { # ---- targets ---- target "almalinux_jdk11" { - dockerfile = "11/almalinux/almalinux8/hotspot/Dockerfile" + dockerfile = "almalinux/almalinux8/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -155,7 +155,7 @@ target "almalinux_jdk11" { } target "alpine_jdk11" { - dockerfile = "11/alpine/hotspot/Dockerfile" + dockerfile = "alpine/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -175,7 +175,7 @@ target "alpine_jdk11" { } target "alpine_jdk17" { - dockerfile = "17/alpine/hotspot/Dockerfile" + dockerfile = "alpine/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -199,7 +199,7 @@ target "alpine_jdk17" { } target "alpine_jdk21" { - dockerfile = "21/alpine/hotspot/Dockerfile" + dockerfile = "alpine/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -219,7 +219,7 @@ target "alpine_jdk21" { } target "debian_jdk11" { - dockerfile = "11/debian/bookworm/hotspot/Dockerfile" + dockerfile = "debian/bookworm/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -240,7 +240,7 @@ target "debian_jdk11" { } target "debian_jdk17" { - dockerfile = "17/debian/bookworm/hotspot/Dockerfile" + dockerfile = "debian/bookworm/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -265,7 +265,7 @@ target "debian_jdk17" { } target "debian_jdk21" { - dockerfile = "21/debian/bookworm/hotspot/Dockerfile" + dockerfile = "debian/bookworm/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -286,7 +286,7 @@ target "debian_jdk21" { } target "debian_slim_jdk11" { - dockerfile = "11/debian/bookworm-slim/hotspot/Dockerfile" + dockerfile = "debian/bookworm-slim/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -305,7 +305,7 @@ target "debian_slim_jdk11" { } target "debian_slim_jdk17" { - dockerfile = "17/debian/bookworm-slim/hotspot/Dockerfile" + dockerfile = "debian/bookworm-slim/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -328,7 +328,7 @@ target "debian_slim_jdk17" { } target "debian_slim_jdk21" { - dockerfile = "21/debian/bookworm-slim/hotspot/Dockerfile" + dockerfile = "debian/bookworm-slim/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -347,7 +347,7 @@ target "debian_slim_jdk21" { } target "rhel_ubi8_jdk11" { - dockerfile = "11/rhel/ubi8/hotspot/Dockerfile" + dockerfile = "rhel/ubi8/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -366,7 +366,7 @@ target "rhel_ubi8_jdk11" { } target "rhel_ubi9_jdk17" { - dockerfile = "17/rhel/ubi9/hotspot/Dockerfile" + dockerfile = "rhel/ubi9/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION @@ -385,7 +385,7 @@ target "rhel_ubi9_jdk17" { } target "rhel_ubi9_jdk21" { - dockerfile = "21/rhel/ubi9/hotspot/Dockerfile" + dockerfile = "rhel/ubi9/hotspot/Dockerfile" context = "." args = { JENKINS_VERSION = JENKINS_VERSION diff --git a/11/rhel/ubi8/hotspot/Dockerfile b/rhel/ubi8/hotspot/Dockerfile similarity index 100% rename from 11/rhel/ubi8/hotspot/Dockerfile rename to rhel/ubi8/hotspot/Dockerfile diff --git a/17/rhel/ubi9/hotspot/Dockerfile b/rhel/ubi9/hotspot/Dockerfile similarity index 89% rename from 17/rhel/ubi9/hotspot/Dockerfile rename to rhel/ubi9/hotspot/Dockerfile index 03a077fcc2..dfd6eca2d9 100644 --- a/17/rhel/ubi9/hotspot/Dockerfile +++ b/rhel/ubi9/hotspot/Dockerfile @@ -14,19 +14,26 @@ RUN dnf install --disableplugin=subscription-manager --setopt=install_weak_deps= && dnf clean --disableplugin=subscription-manager all \ && /usr/bin/jdk-download.sh -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH +ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" # Generate smaller java runtime without unneeded files # for now we include the full module path to maintain compatibility # while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 17 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-java-debug-attributes \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime +RUN case "$(jlink --version 2>&1)" in \ + # jlink version 11 has less features than JDK17+ + "11."*) set -- "--strip-debug" "--compress=2" ;; \ + "17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \ + # the compression argument is different for JDK21 + "21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \ + *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ + esac; \ + jlink \ + "$1" \ + "$2" \ + --add-modules ALL-MODULE-PATH \ + --no-man-pages \ + --no-header-files \ + --output /javaruntime FROM registry.access.redhat.com/ubi9/ubi:9.4-947 AS controller diff --git a/windows/windowsservercore/hotspot/Dockerfile b/windows/windowsservercore/hotspot/Dockerfile index 61a392b4a4..d8f3cb402c 100644 --- a/windows/windowsservercore/hotspot/Dockerfile +++ b/windows/windowsservercore/hotspot/Dockerfile @@ -24,22 +24,25 @@ RUN Write-Host 'javac --version' ; javac --version ; ` Write-Host 'java --version' ; java --version RUN $version = (jlink --version) ; ` - $stripJavaDebugFlags = '--strip-java-debug-attributes' ; ` + $stripJavaDebugArg = '--strip-java-debug-attributes' ; ` $compressArg = '--compress=2' ; ` - # jlink version 11 has less features than JDK17+ - if ($version.StartsWith('11')) { ` - $stripJavaDebugFlags = '--strip-debug' ; ` - } ` - # jlink version 11 has less features than JDK17+ - if ($version.StartsWith('21')) { ` - $compressArg = '--compress=zip-6' ; ` + switch ($version.Substring(0,3)) { ` + # jlink version 11 has less features than JDK17+ + '11.' { $stripJavaDebugArg = '--strip-debug' } ` + '17.' {} ` + # the compression argument is different for JDK21 + '21.' { $compressArg = '--compress=zip-6' } ` + Default { ` + Write-Error 'ERROR: unmanaged jlink version pattern' ; ` + exit 1 ; ` + } ` } ` & jlink ` + $stripJavaDebugArg ` + $compressArg ` --add-modules ALL-MODULE-PATH ` - $stripJavaDebugFlags ` --no-man-pages ` --no-header-files ` - --compress=2 ` --output /javaruntime FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION}" AS controller