diff --git a/11/almalinux/almalinux8/hotspot/Dockerfile b/11/almalinux/almalinux8/hotspot/Dockerfile index 50bd3e7a22..e0c51c1fa0 100644 --- a/11/almalinux/almalinux8/hotspot/Dockerfile +++ b/11/almalinux/almalinux8/hotspot/Dockerfile @@ -1,22 +1,17 @@ -FROM almalinux:8.9 as jre-build ARG JAVA_VERSION=11.0.22_7 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN set -x \ - && dnf -y upgrade-minimal --security \ - && dnf install -y ca-certificates jq wget \ - && JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | awk -F'.' '{print $1}') \ - && ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | tr '_' '+' | jq "@uri" -jRr) \ - && JAVA_VERSION_FILENAME=$(echo "$JAVA_VERSION" | tr '_' '+') \ - && CONVERTED_ARCH=$(arch | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \ - && wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_"${JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \ - && mkdir -p /opt/jdk-"${JAVA_VERSION_FILENAME}" \ - && tar -xzf /tmp/jdk.tar.gz -C /opt/jdk-"${JAVA_VERSION_FILENAME}" --strip-components=1 \ - && rm -f /tmp/jdk.tar.gz \ - && export PATH=/opt/jdk-"${JAVA_VERSION_FILENAME}"/bin:$PATH \ - && jlink --add-modules ALL-MODULE-PATH --no-man-pages --compress=2 --output /javaruntime \ - && dnf clean all +FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy as jre-build + +# 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 almalinux:8.9 diff --git a/11/rhel/ubi8/hotspot/Dockerfile b/11/rhel/ubi8/hotspot/Dockerfile index 85504fe3b0..2862c8fa0b 100644 --- a/11/rhel/ubi8/hotspot/Dockerfile +++ b/11/rhel/ubi8/hotspot/Dockerfile @@ -1,22 +1,17 @@ -FROM registry.access.redhat.com/ubi8/ubi:8.9-1107.1705420509 as jre-build ARG JAVA_VERSION=11.0.22_7 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN set -x \ - && dnf -y upgrade-minimal --security \ - && dnf install -y ca-certificates jq wget \ - && JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | awk -F'.' '{print $1}') \ - && ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | tr '_' '+' | jq "@uri" -jRr) \ - && JAVA_VERSION_FILENAME=$(echo "$JAVA_VERSION" | tr '_' '+') \ - && CONVERTED_ARCH=$(arch | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \ - && wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_"${JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \ - && mkdir -p /opt/jdk-"${JAVA_VERSION_FILENAME}" \ - && tar -xzf /tmp/jdk.tar.gz -C /opt/jdk-"${JAVA_VERSION_FILENAME}" --strip-components=1 \ - && rm -f /tmp/jdk.tar.gz \ - && export PATH=/opt/jdk-"${JAVA_VERSION_FILENAME}"/bin:$PATH \ - && jlink --add-modules ALL-MODULE-PATH --no-man-pages --compress=2 --output /javaruntime \ - && dnf clean all +FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy as jre-build + +# 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 registry.access.redhat.com/ubi8/ubi:8.9-1107.1705420509 diff --git a/17/alpine/hotspot/Dockerfile b/17/alpine/hotspot/Dockerfile index cb8ff16df6..2210b1c0e1 100644 --- a/17/alpine/hotspot/Dockerfile +++ b/17/alpine/hotspot/Dockerfile @@ -6,17 +6,13 @@ FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-alpine AS jre-build # 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 if [ "$TARGETPLATFORM" != 'linux/arm/v7' ]; then \ - jlink \ +RUN jlink \ --add-modules ALL-MODULE-PATH \ --strip-java-debug-attributes \ --no-man-pages \ --no-header-files \ --compress=2 \ - --output /javaruntime; \ - else \ - cp -r /opt/java/openjdk /javaruntime; \ - fi + --output /javaruntime FROM alpine:"${ALPINE_TAG}" AS build diff --git a/21/alpine/hotspot/Dockerfile b/21/alpine/hotspot/Dockerfile index 337cd7b180..18b8515b3d 100644 --- a/21/alpine/hotspot/Dockerfile +++ b/21/alpine/hotspot/Dockerfile @@ -6,17 +6,13 @@ FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-alpine AS jre-build # 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 if [ "$TARGETPLATFORM" != 'linux/arm/v7' ]; then \ - jlink \ +RUN jlink \ --add-modules ALL-MODULE-PATH \ --strip-java-debug-attributes \ --no-man-pages \ --no-header-files \ --compress zip-6 \ - --output /javaruntime; \ - else \ - cp -r /opt/java/openjdk /javaruntime; \ - fi + --output /javaruntime FROM alpine:"${ALPINE_TAG}" AS build diff --git a/21/debian/bookworm-slim/hotspot/Dockerfile b/21/debian/bookworm-slim/hotspot/Dockerfile index a0a939d362..d128e9b918 100644 --- a/21/debian/bookworm-slim/hotspot/Dockerfile +++ b/21/debian/bookworm-slim/hotspot/Dockerfile @@ -6,19 +6,13 @@ FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy as jre-build # 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 if test "${TARGETPLATFORM}" != 'linux/arm/v7'; then \ - jlink \ +RUN jlink \ --add-modules ALL-MODULE-PATH \ --strip-java-debug-attributes \ --no-man-pages \ --no-header-files \ --compress zip-6 \ - --output /javaruntime; \ - # It is acceptable to have a larger image in arm/v7 (arm 32 bits) environment. - # Because jlink fails with the error "jmods: Value too large for defined data type" error. - else \ - cp -r "/opt/jdk-${JAVA_VERSION}" /javaruntime; \ - fi + --output /javaruntime FROM debian:bookworm-"${BOOKWORM_TAG}"-slim diff --git a/21/debian/bookworm-slim/hotspot/preview/Dockerfile b/21/debian/bookworm-slim/hotspot/preview/Dockerfile deleted file mode 100644 index 39a29b0866..0000000000 --- a/21/debian/bookworm-slim/hotspot/preview/Dockerfile +++ /dev/null @@ -1,157 +0,0 @@ -ARG BOOKWORM_TAG=20240130 -FROM debian:bookworm-"${BOOKWORM_TAG}"-slim as jre-build -ARG JAVA_VERSION=21.0.2_13 -ARG TARGETPLATFORM - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -## Example of preview (EA) jdk21 JAVA_VERSION values: -# 21+35 (note: only one number before the "+") -# 21.0.1+12 -## Example of preview (EA) release download link: -# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_ea_21-0-35.tar.gz -# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12-ea-beta/OpenJDK21U-jdk_x64_alpine-linux_hotspot_ea_21-0-1-12.tar.gz -RUN set -x; apt-get update \ - && apt-get install --no-install-recommends -y \ - ca-certificates \ - jq \ - wget \ - && DASHED_JAVA_VERSION=$(echo "$JAVA_VERSION" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \ - && JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | cut -d'+' -f1 | cut -d'.' -f1) \ - && ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | jq "@uri" -jRr) \ - && CONVERTED_ARCH=$(arch | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \ - && wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${DASHED_JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \ - && tar -xzf /tmp/jdk.tar.gz -C /opt/ \ - && rm -f /tmp/jdk.tar.gz - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -RUN if test "${TARGETPLATFORM}" != 'linux/arm/v7'; then \ - jlink \ - --add-modules ALL-MODULE-PATH \ - --no-man-pages \ - --compress=zip-6 \ - --output /javaruntime; \ - # It is acceptable to have a larger image in arm/v7 (arm 32 bits) environment. - # Because jlink fails with the error "jmods: Value too large for defined data type" error. - else \ - cp -r "/opt/jdk-${JAVA_VERSION}" /javaruntime; \ - fi - -FROM debian:bookworm-"${BOOKWORM_TAG}"-slim - -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.15 -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 - -# 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 index 4cdcef2e40..cb1871e95b 100644 --- a/21/debian/bookworm/hotspot/Dockerfile +++ b/21/debian/bookworm/hotspot/Dockerfile @@ -6,19 +6,13 @@ FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy as jre-build # 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 if test "${TARGETPLATFORM}" != 'linux/arm/v7'; then \ - jlink \ +RUN jlink \ --add-modules ALL-MODULE-PATH \ --strip-java-debug-attributes \ --no-man-pages \ --no-header-files \ --compress zip-6 \ - --output /javaruntime; \ - # It is acceptable to have a larger image in arm/v7 (arm 32 bits) environment. - # Because jlink fails with the error "jmods: Value too large for defined data type" error. - else \ - cp -r /opt/java/openjdk /javaruntime; \ - fi + --output /javaruntime FROM debian:bookworm-"${BOOKWORM_TAG}" diff --git a/21/debian/bookworm/hotspot/preview/Dockerfile b/21/debian/bookworm/hotspot/preview/Dockerfile deleted file mode 100644 index 081b9b956f..0000000000 --- a/21/debian/bookworm/hotspot/preview/Dockerfile +++ /dev/null @@ -1,157 +0,0 @@ -ARG BOOKWORM_TAG=20240130 -FROM debian:bookworm-"${BOOKWORM_TAG}"-slim as jre-build -ARG JAVA_VERSION=21.0.2_13 -ARG TARGETPLATFORM - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -## Example of preview (EA) jdk21 JAVA_VERSION values: -# 21+35 (note: only one number before the "+") -# 21.0.1+12 -## Example of preview (EA) release download link: -# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_ea_21-0-35.tar.gz -# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12-ea-beta/OpenJDK21U-jdk_x64_alpine-linux_hotspot_ea_21-0-1-12.tar.gz -RUN set -x; apt-get update \ - && apt-get install --no-install-recommends -y \ - ca-certificates \ - jq \ - wget \ - && DASHED_JAVA_VERSION=$(echo "$JAVA_VERSION" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \ - && JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | cut -d'+' -f1 | cut -d'.' -f1) \ - && ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | jq "@uri" -jRr) \ - && CONVERTED_ARCH=$(arch | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \ - && wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${DASHED_JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \ - && tar -xzf /tmp/jdk.tar.gz -C /opt/ \ - && rm -f /tmp/jdk.tar.gz - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -RUN if test "${TARGETPLATFORM}" != 'linux/arm/v7'; then \ - jlink \ - --add-modules ALL-MODULE-PATH \ - --no-man-pages \ - --compress=zip-6 \ - --output /javaruntime; \ - # It is acceptable to have a larger image in arm/v7 (arm 32 bits) environment. - # Because jlink fails with the error "jmods: Value too large for defined data type" error. - else \ - cp -r "/opt/jdk-${JAVA_VERSION}" /javaruntime; \ - fi - -FROM debian:bookworm-"${BOOKWORM_TAG}" - -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.15 -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 - -# 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 index 36afb6c34c..9e19038f3a 100644 --- a/21/rhel/ubi9/hotspot/Dockerfile +++ b/21/rhel/ubi9/hotspot/Dockerfile @@ -1,26 +1,5 @@ -FROM registry.access.redhat.com/ubi9/ubi:9.3-1552 as jre-build ARG JAVA_VERSION=21.0.2_13 -ARG TARGETPLATFORM - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -## Example of preview (EA) jdk21 JAVA_VERSION values: -# 21+35 (note: only one number before the "+") -# 21.0.1+12 -## Example of preview (EA) release download link: -# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_ea_21-0-35.tar.gz -# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12-ea-beta/OpenJDK21U-jdk_x64_alpine-linux_hotspot_ea_21-0-1-12.tar.gz -RUN set -x; yum install -y jq wget \ - && DASHED_JAVA_VERSION=$(echo "$JAVA_VERSION" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \ - && JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | cut -d'+' -f1 | cut -d'.' -f1) \ - && ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | jq "@uri" -jRr) \ - && CONVERTED_ARCH=$(arch | sed 's/x86_64/x64/') \ - && wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${DASHED_JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \ - && yum clean all \ - && tar -xzf /tmp/jdk.tar.gz -C /opt/ \ - && rm -f /tmp/jdk.tar.gz - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH +FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-ubi9-minimal as jre-build # Generate smaller java runtime without unneeded files # for now we include the full module path to maintain compatibility diff --git a/Jenkinsfile b/Jenkinsfile index dee70f3eb2..34a656f8fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -87,11 +87,9 @@ stage('Build') { 'debian_jdk11', 'debian_jdk17', 'debian_jdk21', - 'debian_jdk21_preview', 'debian_slim_jdk11', 'debian_slim_jdk17', 'debian_slim_jdk21', - 'debian_slim_jdk21_preview', 'rhel_ubi8_jdk11', 'rhel_ubi9_jdk17', 'rhel_ubi9_jdk21', diff --git a/Makefile b/Makefile index 7bf1547490..8da9843a2f 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ export BUILDKIT_PROGRESS=plain export COMMIT_SHA=$(shell git rev-parse HEAD) current_arch := $(shell uname -m) -export ARCH ?= $(shell case $(current_arch) in (x86_64) echo "amd64" ;; (i386) echo "386";; (aarch64|arm64) echo "arm64" ;; (armv6*) echo "arm/v6";; (armv7*) echo "arm/v7";; (s390*|riscv*|ppc64le) echo $(current_arch);; (*) echo "UNKNOWN-CPU";; esac) +export ARCH ?= $(shell case $(current_arch) in (x86_64) echo "amd64" ;; (aarch64|arm64) echo "arm64" ;; (s390*|riscv*|ppc64le) echo $(current_arch);; (*) echo "UNKNOWN-CPU";; esac) all: hadolint shellcheck build test diff --git a/docker-bake.hcl b/docker-bake.hcl index c59cca2d18..e6b8869df6 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -9,11 +9,9 @@ group "linux" { "debian_jdk11", "debian_jdk17", "debian_jdk21", - "debian_jdk21_preview", "debian_slim_jdk11", "debian_slim_jdk17", "debian_slim_jdk21", - "debian_slim_jdk21_preview", "rhel_ubi8_jdk11", "rhel_ubi9_jdk17", "rhel_ubi9_jdk21", @@ -23,9 +21,11 @@ group "linux" { group "linux-arm64" { targets = [ "almalinux_jdk11", + "alpine_jdk21", "debian_jdk11", "debian_jdk17", "debian_jdk21", + "debian_slim_jdk21", "rhel_ubi8_jdk11", "rhel_ubi9_jdk17", "rhel_ubi9_jdk21", @@ -35,6 +35,8 @@ group "linux-arm64" { group "linux-s390x" { targets = [ "debian_jdk11", + "debian_jdk17", + "debian_jdk21", ] } @@ -44,6 +46,7 @@ group "linux-ppc64le" { "debian_jdk17", "debian_jdk21", "rhel_ubi9_jdk17", + "rhel_ubi9_jdk21", ] } @@ -97,12 +100,6 @@ variable "JAVA17_VERSION" { default = "17.0.10_7" } -# not passed through currently as inconsistent versions are published (2023-08-14) -# alpine not published on 34, but x64 on 35 isn't published for linux -variable "JAVA21_PREVIEW_VERSION" { - default = "21.0.1+12" -} - variable "JAVA21_VERSION" { default = "21.0.2_13" } @@ -264,7 +261,7 @@ target "debian_jdk17" { tag_lts(true, "lts"), tag_lts(true, "lts-jdk17") ] - platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le"] + platforms = ["linux/amd64", "linux/arm64", "linux/s390x", "linux/ppc64le"] } target "debian_jdk21" { @@ -285,30 +282,7 @@ target "debian_jdk21" { tag_lts(false, "lts-jdk21"), tag_lts(true, "lts-jdk21") ] - ## TODO: restore architectures when available for https://hub.docker.com/_/eclipse-temurin/tags?page=1&name=21-jdk-jammy - # platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/arm/v7"] - platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le"] -} - -target "debian_jdk21_preview" { - dockerfile = "21/debian/bookworm/hotspot/preview/Dockerfile" - context = "." - args = { - JENKINS_VERSION = JENKINS_VERSION - JENKINS_SHA = JENKINS_SHA - COMMIT_SHA = COMMIT_SHA - PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION - BOOKWORM_TAG = BOOKWORM_TAG - JAVA_VERSION = JAVA21_PREVIEW_VERSION - } - tags = [ - tag(true, "jdk21-preview"), - tag_weekly(false, "latest-jdk21-preview"), - tag_weekly(false, "jdk21-preview"), - tag_lts(false, "lts-jdk21-preview"), - tag_lts(true, "lts-jdk21-preview") - ] - platforms = ["linux/amd64", "linux/arm64", "linux/s390x", "linux/arm/v7"] + platforms = ["linux/amd64", "linux/arm64", "linux/s390x", "linux/ppc64le"] } target "debian_slim_jdk11" { @@ -372,25 +346,6 @@ target "debian_slim_jdk21" { platforms = ["linux/amd64", "linux/arm64"] } -target "debian_slim_jdk21_preview" { - dockerfile = "21/debian/bookworm-slim/hotspot/preview/Dockerfile" - context = "." - args = { - JENKINS_VERSION = JENKINS_VERSION - JENKINS_SHA = JENKINS_SHA - COMMIT_SHA = COMMIT_SHA - PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION - BOOKWORM_TAG = BOOKWORM_TAG - JAVA_VERSION = JAVA21_PREVIEW_VERSION - } - tags = [ - tag(true, "slim-jdk21-preview"), - tag_weekly(false, "slim-jdk21-preview"), - tag_lts(false, "lts-slim-jdk21-preview"), - ] - platforms = ["linux/amd64", "linux/arm64", "linux/s390x", "linux/arm/v7"] -} - target "rhel_ubi8_jdk11" { dockerfile = "11/rhel/ubi8/hotspot/Dockerfile" context = "." @@ -437,13 +392,13 @@ target "rhel_ubi9_jdk21" { JENKINS_SHA = JENKINS_SHA COMMIT_SHA = COMMIT_SHA PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION - JAVA_VERSION = JAVA21_PREVIEW_VERSION + JAVA_VERSION = JAVA21_VERSION } tags = [ - tag(true, "rhel-ubi9-jdk21-preview"), - tag_weekly(false, "rhel-ubi9-jdk21-preview"), - tag_lts(false, "lts-rhel-ubi9-jdk21-preview"), - tag_lts(true, "lts-rhel-ubi9-jdk21-preview") + tag(true, "rhel-ubi9-jdk21"), + tag_weekly(false, "rhel-ubi9-jdk21"), + tag_lts(false, "lts-rhel-ubi9-jdk21"), + tag_lts(true, "lts-rhel-ubi9-jdk21") ] platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le"] } diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index 549ab33197..7193a541c9 100755 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -29,15 +29,6 @@ function get_jdk_download_url() { ## JDK19 URLs have an underscore ('_') instead of a plus ('+') in their archive names echo "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-${jdk_version}/OpenJDK19U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; - 21*-ea-beta) - # JDK preview version (21+35-ea-beta, 21.0.1+12-ea-beta) - jdk_version="${jdk_version//-ea-beta}" - ## https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_aarch64_linux_hotspot_ea_21-0-35.tar.gz - ## https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_ea_21-0-1-12.tar.gz - dashJDKVersion="${jdk_version//+/-}" - completeDashJDKVersion="${dashJDKVersion//./-}" - echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version//+/%2B}-ea-beta/OpenJDK21U-jdk_${platform}_hotspot_ea_${completeDashJDKVersion}" - return 0;; 21*) ## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}"; @@ -58,8 +49,6 @@ case "${1}" in platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");; 19.*+*) platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");; - 21*+*-ea-beta) - platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");; 21*+*) platforms=("x64_linux" "x64_windows" "aarch64_linux");; *) diff --git a/updatecli/updatecli.d/debian.yaml b/updatecli/updatecli.d/debian.yaml index 32748a039b..758ab836d0 100644 --- a/updatecli/updatecli.d/debian.yaml +++ b/updatecli/updatecli.d/debian.yaml @@ -94,24 +94,6 @@ conditions: instruction: keyword: "ARG" matcher: "BOOKWORM_TAG" - testDockerfileArgJDK21Preview: - name: "Does the Dockerfile have an ARG instruction for the Debian Bookworm Linux version?" - kind: dockerfile - disablesourceinput: true - spec: - file: 21/debian/bookworm/hotspot/preview/Dockerfile - instruction: - keyword: "ARG" - matcher: "BOOKWORM_TAG" - testDockerfileArgJDK21SlimPreview: - name: "Does the Dockerfile have an ARG instruction for the Debian Bookworm Linux version?" - kind: dockerfile - disablesourceinput: true - spec: - file: 21/debian/bookworm-slim/hotspot/preview/Dockerfile - instruction: - keyword: "ARG" - matcher: "BOOKWORM_TAG" testVersionInBakeFile: name: "Does the bake file have variable BOOKWORM_TAG" kind: file @@ -181,26 +163,6 @@ targets: keyword: "ARG" matcher: "BOOKWORM_TAG" scmid: default - updateDockerfileJDK21Preview: - name: "Update the value of the base image (ARG BOOKWORM_TAG) in the Dockerfile" - kind: dockerfile - sourceid: bookwormLatestVersion - spec: - file: 21/debian/bookworm/hotspot/preview/Dockerfile - instruction: - keyword: "ARG" - matcher: "BOOKWORM_TAG" - scmid: default - updateDockerfileJDK21SlimPreview: - name: "Update the value of the base image (ARG BOOKWORM_TAG) in the Dockerfile" - kind: dockerfile - sourceid: bookwormLatestVersion - spec: - file: 21/debian/bookworm-slim/hotspot/preview/Dockerfile - instruction: - keyword: "ARG" - matcher: "BOOKWORM_TAG" - scmid: default updateDockerBake: name: "Update the value of the base image (ARG BOOKWORM_TAG) in the docker-bake.hcl" kind: file diff --git a/updatecli/updatecli.d/jdk11.yaml b/updatecli/updatecli.d/jdk11.yaml index 51ab8f9f68..443ac3063d 100644 --- a/updatecli/updatecli.d/jdk11.yaml +++ b/updatecli/updatecli.d/jdk11.yaml @@ -49,7 +49,6 @@ conditions: - amd64 - arm64 - s390x - - linux/arm/v7 image: eclipse-temurin tag: '{{source "lastVersion" }}-jdk-jammy' checkTemurinNanoserver2019DockerImage: diff --git a/updatecli/updatecli.d/jdk17.yaml b/updatecli/updatecli.d/jdk17.yaml index e59628568a..f20b25a155 100644 --- a/updatecli/updatecli.d/jdk17.yaml +++ b/updatecli/updatecli.d/jdk17.yaml @@ -50,7 +50,6 @@ conditions: - amd64 - arm64 - s390x - - linux/arm/v7 image: eclipse-temurin tag: '{{source "lastVersion" }}-jdk-focal' checkTemurinNanoserver2019DockerImage: diff --git a/updatecli/updatecli.d/jdk21-preview.yaml b/updatecli/updatecli.d/jdk21-preview.yaml deleted file mode 100644 index 07d8c7ed74..0000000000 --- a/updatecli/updatecli.d/jdk21-preview.yaml +++ /dev/null @@ -1,87 +0,0 @@ ---- -name: Bump JDK21 preview version (EA) for all Linux images - -scms: - default: - kind: github - spec: - user: "{{ .github.user }}" - email: "{{ .github.email }}" - owner: "{{ .github.owner }}" - repository: "{{ .github.repository }}" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - branch: "{{ .github.branch }}" - temurin21-binaries: - kind: "github" - spec: - user: "{{ .github.user }}" - email: "{{ .github.email }}" - owner: "adoptium" - repository: "temurin21-binaries" - token: '{{ requiredEnv .github.token }}' - branch: "main" - -sources: - getLatestJDK21PreviewVersion: - name: Get the latest Adoptium JDK21 preview version (EA) - kind: gittag - scmid: temurin21-binaries - spec: - versionfilter: - kind: regex - pattern: ".*-ea-.*" - transformers: - - trimprefix: "jdk-" - - trimsuffix: "-ea-beta" - -conditions: - checkIfReleaseIsAvailable: - kind: shell - spec: - command: bash ./updatecli/scripts/check-jdk.sh # source input value passed as argument - transformers: - - addsuffix: "-ea-beta" - -targets: - setJDK21PreviewVersionDockerBake: - name: "Bump JDK21 preview version (EA) for Linux images in the docker-bake.hcl file" - kind: hcl - spec: - file: docker-bake.hcl - path: variable.JAVA21_PREVIEW_VERSION.default - scmid: default - setJDK21PreviewVersionDebian: - name: "Bump JDK21 preview version (EA) for Linux images in the Debian Dockerfile" - kind: dockerfile - spec: - file: 21/debian/bookworm/hotspot/preview/Dockerfile - instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" - setJDK21PreviewVersionDebianSlim: - name: "Bump JDK21 preview version (EA) for Linux images in the Debian Slim Dockerfile" - kind: dockerfile - spec: - file: 21/debian/bookworm-slim/hotspot/preview/Dockerfile - instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" - setJDK21PreviewVersionRhel: - name: "Bump JDK21 preview version (EA) for Linux images in the Rhel Dockerfile" - kind: dockerfile - spec: - file: 21/rhel/ubi9/hotspot/Dockerfile - instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" - -actions: - default: - kind: github/pullrequest - scmid: default - title: Bump JDK21 preview version (EA) to {{ source "getLatestJDK21PreviewVersion" }} - spec: - labels: - - dependencies - - jdk21-preview diff --git a/updatecli/updatecli.d/jdk21.yaml b/updatecli/updatecli.d/jdk21.yaml index 2e8c101fb8..01f7e604a8 100644 --- a/updatecli/updatecli.d/jdk21.yaml +++ b/updatecli/updatecli.d/jdk21.yaml @@ -1,5 +1,5 @@ --- -name: Bump JDK21 version for all Linux images +name: Bump JDK21 version scms: default: @@ -12,40 +12,76 @@ scms: token: "{{ requiredEnv .github.token }}" username: "{{ .github.username }}" branch: "{{ .github.branch }}" - temurin21-binaries: - kind: "github" - spec: - user: "{{ .github.user }}" - email: "{{ .github.email }}" - owner: "adoptium" - repository: "temurin21-binaries" - token: '{{ requiredEnv .github.token }}' - branch: "main" sources: - getLatestJDK21Version: + lastVersion: + kind: githubrelease name: Get the latest Adoptium JDK21 version - kind: gittag - scmid: temurin21-binaries spec: + owner: "adoptium" + repository: "temurin21-binaries" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" versionfilter: kind: regex - pattern: "\\d$" + pattern: "^jdk-21.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$" transformers: - trimprefix: "jdk-" - replacer: - from: "+" - to: "_" + from: + + to: _ conditions: - checkIfReleaseIsAvailable: - kind: shell + checkTemurinAlpineDockerImage: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-alpine" is available + disablesourceinput: true spec: - command: bash ./updatecli/scripts/check-jdk.sh # source input value passed as argument - transformers: - - replacer: - from: "_" - to: "+" + image: eclipse-temurin + tag: '{{source "lastVersion" }}-jdk-alpine' + checkTemurinDebianDockerImages: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-focal" is available + disablesourceinput: true + spec: + architectures: + - amd64 + - arm64 + - s390x + image: eclipse-temurin + tag: '{{source "lastVersion" }}-jdk-focal' + checkTemurinNanoserver2019DockerImage: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-nanoserver-1809" is available + disablesourceinput: true + spec: + # architecture: amd64 + image: eclipse-temurin + tag: '{{source "lastVersion" }}-jdk-nanoserver-1809' + checkTemurinWindowsCore2019DockerImage: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available + disablesourceinput: true + spec: + # architecture: amd64 + image: eclipse-temurin + tag: '{{source "lastVersion" }}-jdk-windowsservercore-1809' + checkTemurinNanoserver2022DockerImage: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-nanoserver-ltsc2022" is available + disablesourceinput: true + spec: + # architecture: amd64 + image: eclipse-temurin + tag: '{{source "lastVersion" }}-jdk-nanoserver-ltsc2022' + checkTemurinWindowsCore2022DockerImage: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-18ltsc202209" is available + disablesourceinput: true + spec: + # architecture: amd64 + image: eclipse-temurin + tag: '{{source "lastVersion" }}-jdk-windowsservercore-ltsc2022' targets: setJDK21VersionDockerBake: @@ -61,30 +97,42 @@ targets: spec: file: 21/alpine/hotspot/Dockerfile instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" + keyword: ARG + matcher: JAVA_VERSION + scmid: default setJDK21VersionDebian: name: "Bump JDK21 version for Linux images in the Debian Dockerfile" kind: dockerfile spec: file: 21/debian/bookworm/hotspot/Dockerfile instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" + keyword: ARG + matcher: JAVA_VERSION + scmid: default setJDK21VersionDebianSlim: name: "Bump JDK21 version for Linux images in the Debian Slim Dockerfile" kind: dockerfile spec: file: 21/debian/bookworm-slim/hotspot/Dockerfile instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" + keyword: ARG + matcher: JAVA_VERSION + scmid: default + setJDK21VersionRhel: + name: "Bump JDK21 version for Linux images in the Rhel Dockerfile" + kind: dockerfile + spec: + file: 21/rhel/ubi9/hotspot/Dockerfile + instruction: + keyword: ARG + matcher: JAVA_VERSION + scmid: default actions: default: kind: github/pullrequest scmid: default - title: Bump JDK21 version to {{ source "getLatestJDK21Version" }} + title: Bump JDK21 version to {{ source "lastVersion" }} spec: labels: - dependencies