From a229a446a9f3e718dcbbbad183cfa2ce9c0a1a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Thu, 12 Oct 2023 01:13:59 +0200 Subject: [PATCH 01/27] feat(Linux): add Java 21 --- alpine/21/Dockerfile | 93 -------------------------------------------- debian/21/Dockerfile | 91 ------------------------------------------- debian/Dockerfile | 2 +- docker-bake.hcl | 26 ++++++------- 4 files changed, 14 insertions(+), 198 deletions(-) delete mode 100644 alpine/21/Dockerfile delete mode 100644 debian/21/Dockerfile diff --git a/alpine/21/Dockerfile b/alpine/21/Dockerfile deleted file mode 100644 index a1b0fde36..000000000 --- a/alpine/21/Dockerfile +++ /dev/null @@ -1,93 +0,0 @@ -ARG ALPINE_TAG=3.18.4 -FROM alpine:"${ALPINE_TAG}" AS jre-build -ARG JAVA_VERSION -ARG TARGETPLATFORM - -# hadolint ignore=DL4006 -RUN apk add --no-cache jq wget \ - && BUILD_NUMBER=$(echo $JAVA_VERSION | cut -d'+' -f2) \ - && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ - && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_alpine-linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".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 - -# 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) -RUN if [ "$TARGETPLATFORM" != 'linux/arm/v7' ]; then \ - case "$(jlink --version 2>&1)" in \ - # jlink version 11 has less features than JDK17+ - "11."*) strip_java_debug_flags="--strip-debug" ;; \ - *) strip_java_debug_flags="--strip-java-debug-attributes" ;; \ - esac; \ - jlink \ - --add-modules ALL-MODULE-PATH \ - "$strip_java_debug_flags" \ - --no-man-pages \ - --no-header-files \ - --compress=zip-6 \ - --output /javaruntime; \ - else \ - cp -r /opt/jdk-${JAVA_VERSION} /javaruntime; \ - fi - -FROM alpine:"${ALPINE_TAG}" AS build - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 - -RUN addgroup -g "${gid}" "${group}" \ - && adduser -h /home/"${user}" -u "${uid}" -G "${group}" -D "${user}" - -ARG AGENT_WORKDIR=/home/"${user}"/agent - -ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -ENV TZ=Etc/UTC - -## Always use the latest Alpine packages: no need for versions -# hadolint ignore=DL3018 -RUN apk add --no-cache \ - curl \ - bash \ - git \ - git-lfs \ - musl-locales \ - openssh-client \ - openssl \ - procps \ - tzdata \ - tzdata-utils \ - && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/* - -ARG VERSION=3148.v532a_7e715ee3 -ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" /usr/share/jenkins/agent.jar -RUN chmod 0644 /usr/share/jenkins/agent.jar \ - && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar - - -ENV JAVA_HOME=/opt/java/openjdk -COPY --from=jre-build /javaruntime "$JAVA_HOME" -ENV PATH="${JAVA_HOME}/bin:${PATH}" - -USER "${user}" -ENV AGENT_WORKDIR="${AGENT_WORKDIR}" -RUN mkdir /home/"${user}"/.jenkins && mkdir -p "${AGENT_WORKDIR}" - -VOLUME /home/"${user}"/.jenkins -VOLUME "${AGENT_WORKDIR}" -WORKDIR /home/"${user}" -ENV user=${user} -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ - org.opencontainers.image.version="${VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/debian/21/Dockerfile b/debian/21/Dockerfile deleted file mode 100644 index c289a9024..000000000 --- a/debian/21/Dockerfile +++ /dev/null @@ -1,91 +0,0 @@ -ARG DEBIAN_RELEASE=bookworm-20230904 -FROM debian:"${DEBIAN_RELEASE}"-slim as jre-build -ARG JAVA_VERSION -ARG TARGETPLATFORM - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN set -x; apt-get update \ - && apt-get install --no-install-recommends -y \ - ca-certificates \ - jq \ - wget \ - && BUILD_NUMBER=$(echo $JAVA_VERSION | cut -d'+' -f2) \ - && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ - && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".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:"${DEBIAN_RELEASE}" AS build - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 - -RUN groupadd -g "${gid}" "${group}" \ - && useradd -l -c "Jenkins user" -d /home/"${user}" -u "${uid}" -g "${gid}" -m "${user}" - -ARG AGENT_WORKDIR=/home/"${user}"/agent -ENV TZ=Etc/UTC - -## Always use the latest Debian packages: no need for versions -# hadolint ignore=DL3008 -RUN apt-get update \ - && apt-get --yes --no-install-recommends install \ - ca-certificates \ - curl \ - fontconfig \ - git \ - git-lfs \ - less \ - netbase \ - openssh-client \ - patch \ - tzdata \ - && apt-get clean \ - && rm -rf /tmp/* /var/cache/* /var/lib/apt/lists/* - -ARG VERSION=3148.v532a_7e715ee3 -ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" /usr/share/jenkins/agent.jar -RUN chmod 0644 /usr/share/jenkins/agent.jar \ - && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar - -ENV LANG C.UTF-8 - -ENV JAVA_HOME=/opt/java/openjdk -COPY --from=jre-build /javaruntime "$JAVA_HOME" -ENV PATH="${JAVA_HOME}/bin:${PATH}" - -USER "${user}" -ENV AGENT_WORKDIR=${AGENT_WORKDIR} -RUN mkdir /home/${user}/.jenkins && mkdir -p "${AGENT_WORKDIR}" - -VOLUME /home/"${user}"/.jenkins -VOLUME "${AGENT_WORKDIR}" -WORKDIR /home/"${user}" -ENV user=${user} -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ - org.opencontainers.image.version="${VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/debian/Dockerfile b/debian/Dockerfile index cd6203bf5..b398e7f12 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -21,7 +21,7 @@ # THE SOFTWARE. ARG DEBIAN_RELEASE=bookworm-20230904 ARG JAVA_VERSION=17.0.8.1_1 -FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-focal AS jre-build +FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy AS jre-build # This Build ARG is populated by Docker # Ref. https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope diff --git a/docker-bake.hcl b/docker-bake.hcl index a13d9ff02..a24e49794 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -149,7 +149,7 @@ target "alpine_jdk17" { } target "alpine_jdk21" { - dockerfile = "alpine/21/Dockerfile" + dockerfile = "alpine/Dockerfile" context = "." args = { ALPINE_TAG = ALPINE_FULL_TAG @@ -157,12 +157,12 @@ target "alpine_jdk21" { VERSION = REMOTING_VERSION } tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk21-preview" : "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}-jdk21-preview" : "", - "${REGISTRY}/${JENKINS_REPO}:alpine-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk21-preview", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk21" : "", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}-jdk21" : "", + "${REGISTRY}/${JENKINS_REPO}:alpine-jdk21", + "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk21", ] platforms = ["linux/amd64", "linux/arm64"] } @@ -208,7 +208,7 @@ target "debian_jdk17" { target "debian_jdk21" { - dockerfile = "debian/21/Dockerfile" + dockerfile = "debian/Dockerfile" context = "." args = { JAVA_VERSION = JAVA21_VERSION @@ -216,11 +216,11 @@ target "debian_jdk21" { DEBIAN_RELEASE = DEBIAN_RELEASE } tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk21-preview" : "", - "${REGISTRY}/${JENKINS_REPO}:bookworm-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-jdk21-preview", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk21" : "", + "${REGISTRY}/${JENKINS_REPO}:bookworm-jdk21", + "${REGISTRY}/${JENKINS_REPO}:jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-jdk21", ] platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "linux/arm/v7"] } From dac97beaedcbf4ab019f6c1655ab851d23bc99c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Thu, 12 Oct 2023 10:26:41 +0200 Subject: [PATCH 02/27] fix jdk21 version in docker-bake and updatecli script --- docker-bake.hcl | 2 +- updatecli/scripts/check-jdk.sh | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index a24e49794..139b777d0 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -83,7 +83,7 @@ variable "JAVA17_VERSION" { } variable "JAVA21_VERSION" { - default = "21+35" + default = "21_35" } target "archlinux_jdk11" { diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index 003f49178..1200f4e40 100644 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -30,10 +30,9 @@ function get_jdk_download_url() { echo "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-${jdk_version}/OpenJDK19U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; 21*) - # JDK version (21+35-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 - urlEncodedJDKVersion="${jdk_version//+/%2B}" - echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}-ea-beta/OpenJDK21U-jdk_${platform}_hotspot_ea_21-0-$(echo ${jdk_version} | cut -d '+' -f 2 | cut -d '-' -f 1)" + ## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names, and "-debugimage" instead of "-jdk" + # TODO: replace "-debugimage" by "-jdk" in link when those binaries will be published + echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version}/OpenJDK21U-debugimage_${platform}_hotspot_${jdk_version//+/_}"; return 0;; *) echo "ERROR: unsupported JDK version (${jdk_version})."; From c8a27ebbef7e86c1b12077e66ec8c1211137e6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Thu, 12 Oct 2023 11:17:09 +0200 Subject: [PATCH 03/27] remove linux-arm32 and linux-ppc64le architectures for jdk21, unavailable in eclipse-temurin images --- docker-bake.hcl | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 139b777d0..0ff1b102d 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -23,7 +23,6 @@ group "linux-arm32" { targets = [ "debian_jdk11", "debian_jdk17", - "debian_jdk21" ] } @@ -38,7 +37,6 @@ group "linux-ppc64le" { targets = [ "debian_jdk11", "debian_jdk17", - "debian_jdk21" ] } From 8fa815e285bae4154a1b6532565f67b82d642423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Thu, 12 Oct 2023 11:38:49 +0200 Subject: [PATCH 04/27] also remove linux-s390x for jdk21 --- docker-bake.hcl | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 0ff1b102d..7618b35de 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -29,7 +29,6 @@ group "linux-arm32" { group "linux-s390x" { targets = [ "debian_jdk11", - "debian_jdk21" ] } From 5c62d0db762851bb4751885559297671fc9b9b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Thu, 12 Oct 2023 11:45:35 +0200 Subject: [PATCH 05/27] keep jdk21-preview for architectures unsupported by eclipse-temurin:21 image --- debian/21/Dockerfile | 91 ++++++++++++++++++++++++++++++++++++++++++++ docker-bake.hcl | 24 +++++++++++- 2 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 debian/21/Dockerfile diff --git a/debian/21/Dockerfile b/debian/21/Dockerfile new file mode 100644 index 000000000..84cc34444 --- /dev/null +++ b/debian/21/Dockerfile @@ -0,0 +1,91 @@ +ARG DEBIAN_RELEASE=bookworm-20230904 +FROM debian:"${DEBIAN_RELEASE}"-slim as jre-build +ARG JAVA_VERSION +ARG TARGETPLATFORM + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN set -x; apt-get update \ + && apt-get install --no-install-recommends -y \ + ca-certificates \ + jq \ + wget \ + && BUILD_NUMBER=$(echo $JAVA_VERSION | cut -d'+' -f2) \ + && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ + && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".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:"${DEBIAN_RELEASE}" AS build + +ARG user=jenkins +ARG group=jenkins +ARG uid=1000 +ARG gid=1000 + +RUN groupadd -g "${gid}" "${group}" \ + && useradd -l -c "Jenkins user" -d /home/"${user}" -u "${uid}" -g "${gid}" -m "${user}" + +ARG AGENT_WORKDIR=/home/"${user}"/agent +ENV TZ=Etc/UTC + +## Always use the latest Debian packages: no need for versions +# hadolint ignore=DL3008 +RUN apt-get update \ + && apt-get --yes --no-install-recommends install \ + ca-certificates \ + curl \ + fontconfig \ + git \ + git-lfs \ + less \ + netbase \ + openssh-client \ + patch \ + tzdata \ + && apt-get clean \ + && rm -rf /tmp/* /var/cache/* /usr/share/doc/* /usr/share/man/* /var/lib/apt/lists/* + +ARG VERSION=3148.v532a_7e715ee3 +ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" /usr/share/jenkins/agent.jar +RUN chmod 0644 /usr/share/jenkins/agent.jar \ + && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar + +ENV LANG C.UTF-8 + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=jre-build /javaruntime "$JAVA_HOME" +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +USER "${user}" +ENV AGENT_WORKDIR=${AGENT_WORKDIR} +RUN mkdir /home/${user}/.jenkins && mkdir -p "${AGENT_WORKDIR}" + +VOLUME /home/"${user}"/.jenkins +VOLUME "${AGENT_WORKDIR}" +WORKDIR /home/"${user}" +ENV user=${user} +LABEL \ + org.opencontainers.image.vendor="Jenkins project" \ + org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ + org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ + org.opencontainers.image.version="${VERSION}" \ + org.opencontainers.image.url="https://www.jenkins.io/" \ + org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ + org.opencontainers.image.licenses="MIT" diff --git a/docker-bake.hcl b/docker-bake.hcl index 7618b35de..5922b2af3 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -23,12 +23,14 @@ group "linux-arm32" { targets = [ "debian_jdk11", "debian_jdk17", + "debian_jdk21_preview" ] } group "linux-s390x" { targets = [ "debian_jdk11", + "debian_jdk21_preview" ] } @@ -36,6 +38,7 @@ group "linux-ppc64le" { targets = [ "debian_jdk11", "debian_jdk17", + "debian_jdk21_preview" ] } @@ -203,7 +206,6 @@ target "debian_jdk17" { platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/ppc64le"] } - target "debian_jdk21" { dockerfile = "debian/Dockerfile" context = "." @@ -219,5 +221,23 @@ target "debian_jdk21" { "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21", "${REGISTRY}/${JENKINS_REPO}:latest-jdk21", ] - platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "linux/arm/v7"] + platforms = ["linux/amd64", "linux/arm64"] +} + +target "debian_jdk21_preview" { + dockerfile = "debian/21/Dockerfile" + context = "." + args = { + JAVA_VERSION = JAVA21_VERSION + VERSION = REMOTING_VERSION + DEBIAN_RELEASE = DEBIAN_RELEASE + } + tags = [ + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk21-preview" : "", + "${REGISTRY}/${JENKINS_REPO}:bookworm-jdk21-preview", + "${REGISTRY}/${JENKINS_REPO}:jdk21-preview", + "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21-preview", + "${REGISTRY}/${JENKINS_REPO}:latest-jdk21-preview", + ] + platforms = ["linux/ppc64le", "linux/s390x", "linux/arm/v7"] } From 2777001347784f9dd14d84deea2ef1689a2ae7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Thu, 12 Oct 2023 11:52:56 +0200 Subject: [PATCH 06/27] update jdk21 updatecli manifest --- updatecli/updatecli.d/jdk21.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/updatecli/updatecli.d/jdk21.yaml b/updatecli/updatecli.d/jdk21.yaml index 43928b7a9..1e06125fe 100644 --- a/updatecli/updatecli.d/jdk21.yaml +++ b/updatecli/updatecli.d/jdk21.yaml @@ -27,13 +27,8 @@ sources: name: Get the latest Adoptium JDK21 version kind: gittag scmid: temurin21-binaries - spec: - versionfilter: - kind: regex - pattern: ".*-ea-.*" transformers: - trimprefix: "jdk-" - - trimsuffix: "-ea-beta" conditions: checkIfReleaseIsAvailable: @@ -49,7 +44,10 @@ targets: file: docker-bake.hcl path: variable.JAVA21_VERSION.default scmid: default - + transformers: + - replacers: + - from: "+" + to: "_" actions: default: kind: github/pullrequest From 4a41fccedaf1729d93d2c80c41faa3bc2224a9b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Thu, 12 Oct 2023 12:17:20 +0200 Subject: [PATCH 07/27] Revert "keep jdk21-preview for architectures unsupported by eclipse-temurin:21 image" "also remove linux-s390x for jdk21" "remove linux-arm32 and linux-ppc64le architectures for jdk21, unavailable in eclipse-temurin images" This reverts commits bce36e241d561465c7ceea558bb4144979199280, d154f2e4bd7ac0ac52f70f80e464f770deecc8b3 and a900d2dd1f3787190863b624737ce3895c59761c --- debian/21/Dockerfile | 91 -------------------------------------------- docker-bake.hcl | 27 +++---------- 2 files changed, 5 insertions(+), 113 deletions(-) delete mode 100644 debian/21/Dockerfile diff --git a/debian/21/Dockerfile b/debian/21/Dockerfile deleted file mode 100644 index 84cc34444..000000000 --- a/debian/21/Dockerfile +++ /dev/null @@ -1,91 +0,0 @@ -ARG DEBIAN_RELEASE=bookworm-20230904 -FROM debian:"${DEBIAN_RELEASE}"-slim as jre-build -ARG JAVA_VERSION -ARG TARGETPLATFORM - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN set -x; apt-get update \ - && apt-get install --no-install-recommends -y \ - ca-certificates \ - jq \ - wget \ - && BUILD_NUMBER=$(echo $JAVA_VERSION | cut -d'+' -f2) \ - && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ - && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".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:"${DEBIAN_RELEASE}" AS build - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 - -RUN groupadd -g "${gid}" "${group}" \ - && useradd -l -c "Jenkins user" -d /home/"${user}" -u "${uid}" -g "${gid}" -m "${user}" - -ARG AGENT_WORKDIR=/home/"${user}"/agent -ENV TZ=Etc/UTC - -## Always use the latest Debian packages: no need for versions -# hadolint ignore=DL3008 -RUN apt-get update \ - && apt-get --yes --no-install-recommends install \ - ca-certificates \ - curl \ - fontconfig \ - git \ - git-lfs \ - less \ - netbase \ - openssh-client \ - patch \ - tzdata \ - && apt-get clean \ - && rm -rf /tmp/* /var/cache/* /usr/share/doc/* /usr/share/man/* /var/lib/apt/lists/* - -ARG VERSION=3148.v532a_7e715ee3 -ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" /usr/share/jenkins/agent.jar -RUN chmod 0644 /usr/share/jenkins/agent.jar \ - && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar - -ENV LANG C.UTF-8 - -ENV JAVA_HOME=/opt/java/openjdk -COPY --from=jre-build /javaruntime "$JAVA_HOME" -ENV PATH="${JAVA_HOME}/bin:${PATH}" - -USER "${user}" -ENV AGENT_WORKDIR=${AGENT_WORKDIR} -RUN mkdir /home/${user}/.jenkins && mkdir -p "${AGENT_WORKDIR}" - -VOLUME /home/"${user}"/.jenkins -VOLUME "${AGENT_WORKDIR}" -WORKDIR /home/"${user}" -ENV user=${user} -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ - org.opencontainers.image.version="${VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/docker-bake.hcl b/docker-bake.hcl index 5922b2af3..139b777d0 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -23,14 +23,14 @@ group "linux-arm32" { targets = [ "debian_jdk11", "debian_jdk17", - "debian_jdk21_preview" + "debian_jdk21" ] } group "linux-s390x" { targets = [ "debian_jdk11", - "debian_jdk21_preview" + "debian_jdk21" ] } @@ -38,7 +38,7 @@ group "linux-ppc64le" { targets = [ "debian_jdk11", "debian_jdk17", - "debian_jdk21_preview" + "debian_jdk21" ] } @@ -206,6 +206,7 @@ target "debian_jdk17" { platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/ppc64le"] } + target "debian_jdk21" { dockerfile = "debian/Dockerfile" context = "." @@ -221,23 +222,5 @@ target "debian_jdk21" { "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21", "${REGISTRY}/${JENKINS_REPO}:latest-jdk21", ] - platforms = ["linux/amd64", "linux/arm64"] -} - -target "debian_jdk21_preview" { - dockerfile = "debian/21/Dockerfile" - context = "." - args = { - JAVA_VERSION = JAVA21_VERSION - VERSION = REMOTING_VERSION - DEBIAN_RELEASE = DEBIAN_RELEASE - } - tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk21-preview" : "", - "${REGISTRY}/${JENKINS_REPO}:bookworm-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-jdk21-preview", - ] - platforms = ["linux/ppc64le", "linux/s390x", "linux/arm/v7"] + platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "linux/arm/v7"] } From 7b24f4efb2148e4d5fc6e98e970316469e9b81a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Thu, 12 Oct 2023 14:12:13 +0200 Subject: [PATCH 08/27] remove s390x target architecture for jdk21 as temurin won't support it --- docker-bake.hcl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 139b777d0..ae5a3b016 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -30,7 +30,6 @@ group "linux-arm32" { group "linux-s390x" { targets = [ "debian_jdk11", - "debian_jdk21" ] } @@ -222,5 +221,5 @@ target "debian_jdk21" { "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21", "${REGISTRY}/${JENKINS_REPO}:latest-jdk21", ] - platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "linux/arm/v7"] + platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/arm/v7"] } From 2c5fd09de76ea97eac219b295486f688b5474641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= <91831478+lemeurherve@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:40:36 +0200 Subject: [PATCH 09/27] Update check-jdk.sh --- updatecli/scripts/check-jdk.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index 1200f4e40..32d9a8dba 100644 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -31,8 +31,7 @@ function get_jdk_download_url() { return 0;; 21*) ## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names, and "-debugimage" instead of "-jdk" - # TODO: replace "-debugimage" by "-jdk" in link when those binaries will be published - echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version}/OpenJDK21U-debugimage_${platform}_hotspot_${jdk_version//+/_}"; + echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version//+/_}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; *) echo "ERROR: unsupported JDK version (${jdk_version})."; From 17b8e4d97d309b1863853161acbd8844f87f0374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= <91831478+lemeurherve@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:47:58 +0200 Subject: [PATCH 10/27] Update check-jdk.sh --- updatecli/scripts/check-jdk.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index 32d9a8dba..5a453712d 100644 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -30,8 +30,9 @@ function get_jdk_download_url() { echo "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-${jdk_version}/OpenJDK19U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; 21*) - ## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names, and "-debugimage" instead of "-jdk" - echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version//+/_}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}"; + ## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names + urlEncodedJDKVersion="${jdk_version//+/%2B}" + echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; *) echo "ERROR: unsupported JDK version (${jdk_version})."; From 9a23800b011457edba3fcf87d2c24af53a709814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= <91831478+lemeurherve@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:48:51 +0200 Subject: [PATCH 11/27] Update check-jdk.sh --- updatecli/scripts/check-jdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index 5a453712d..092ecb1bd 100644 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -32,7 +32,7 @@ function get_jdk_download_url() { 21*) ## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names urlEncodedJDKVersion="${jdk_version//+/%2B}" - echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}"; + echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; *) echo "ERROR: unsupported JDK version (${jdk_version})."; From 81935bd3a59fe13d6c6f83fec485c53ed3ab2c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Tue, 17 Oct 2023 20:02:25 +0200 Subject: [PATCH 12/27] try out the two available architectures for now --- docker-bake.hcl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index ae5a3b016..4dbf0ed8d 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -221,5 +221,6 @@ target "debian_jdk21" { "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21", "${REGISTRY}/${JENKINS_REPO}:latest-jdk21", ] - platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/arm/v7"] + platforms = ["linux/amd64", "linux/arm64"] + # platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/arm/v7"] } From cb315b30ad9d97cf3f6230b7e09459442889f54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Tue, 17 Oct 2023 20:50:07 +0200 Subject: [PATCH 13/27] restore updatecli folder for now --- updatecli/scripts/check-jdk.sh | 5 +++-- updatecli/updatecli.d/jdk21.yaml | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index 092ecb1bd..003f49178 100644 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -30,9 +30,10 @@ function get_jdk_download_url() { echo "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-${jdk_version}/OpenJDK19U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; 21*) - ## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names + # JDK version (21+35-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 urlEncodedJDKVersion="${jdk_version//+/%2B}" - echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}"; + echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}-ea-beta/OpenJDK21U-jdk_${platform}_hotspot_ea_21-0-$(echo ${jdk_version} | cut -d '+' -f 2 | cut -d '-' -f 1)" return 0;; *) echo "ERROR: unsupported JDK version (${jdk_version})."; diff --git a/updatecli/updatecli.d/jdk21.yaml b/updatecli/updatecli.d/jdk21.yaml index 1e06125fe..43928b7a9 100644 --- a/updatecli/updatecli.d/jdk21.yaml +++ b/updatecli/updatecli.d/jdk21.yaml @@ -27,8 +27,13 @@ sources: name: Get the latest Adoptium JDK21 version kind: gittag scmid: temurin21-binaries + spec: + versionfilter: + kind: regex + pattern: ".*-ea-.*" transformers: - trimprefix: "jdk-" + - trimsuffix: "-ea-beta" conditions: checkIfReleaseIsAvailable: @@ -44,10 +49,7 @@ targets: file: docker-bake.hcl path: variable.JAVA21_VERSION.default scmid: default - transformers: - - replacers: - - from: "+" - to: "_" + actions: default: kind: github/pullrequest From 378d786161ce880512dc6331c549a714e4673bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Wed, 18 Oct 2023 00:08:09 +0200 Subject: [PATCH 14/27] Revert "try out the two available architectures for now" This reverts commit e47db5e35388f43b3f98fb4532a0076b168f4718. --- docker-bake.hcl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 4dbf0ed8d..ae5a3b016 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -221,6 +221,5 @@ target "debian_jdk21" { "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21", "${REGISTRY}/${JENKINS_REPO}:latest-jdk21", ] - platforms = ["linux/amd64", "linux/arm64"] - # platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/arm/v7"] + platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/arm/v7"] } From fbe1d15b5fbda89816d58de7bca382230280f5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Fri, 20 Oct 2023 14:45:56 +0200 Subject: [PATCH 15/27] Revert "Revert "keep jdk21-preview for architectures unsupported by eclipse-temurin:21 image" "also remove linux-s390x for jdk21" "remove linux-arm32 and linux-ppc64le architectures for jdk21, unavailable in eclipse-temurin images"" This reverts commit 3a9d48054ef3a8f403d12a9cbd7b0e207f448bf4. --- debian/21/Dockerfile | 91 ++++++++++++++++++++++++++++++++++++++++++++ docker-bake.hcl | 26 +++++++++++-- 2 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 debian/21/Dockerfile diff --git a/debian/21/Dockerfile b/debian/21/Dockerfile new file mode 100644 index 000000000..84cc34444 --- /dev/null +++ b/debian/21/Dockerfile @@ -0,0 +1,91 @@ +ARG DEBIAN_RELEASE=bookworm-20230904 +FROM debian:"${DEBIAN_RELEASE}"-slim as jre-build +ARG JAVA_VERSION +ARG TARGETPLATFORM + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN set -x; apt-get update \ + && apt-get install --no-install-recommends -y \ + ca-certificates \ + jq \ + wget \ + && BUILD_NUMBER=$(echo $JAVA_VERSION | cut -d'+' -f2) \ + && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ + && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".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:"${DEBIAN_RELEASE}" AS build + +ARG user=jenkins +ARG group=jenkins +ARG uid=1000 +ARG gid=1000 + +RUN groupadd -g "${gid}" "${group}" \ + && useradd -l -c "Jenkins user" -d /home/"${user}" -u "${uid}" -g "${gid}" -m "${user}" + +ARG AGENT_WORKDIR=/home/"${user}"/agent +ENV TZ=Etc/UTC + +## Always use the latest Debian packages: no need for versions +# hadolint ignore=DL3008 +RUN apt-get update \ + && apt-get --yes --no-install-recommends install \ + ca-certificates \ + curl \ + fontconfig \ + git \ + git-lfs \ + less \ + netbase \ + openssh-client \ + patch \ + tzdata \ + && apt-get clean \ + && rm -rf /tmp/* /var/cache/* /usr/share/doc/* /usr/share/man/* /var/lib/apt/lists/* + +ARG VERSION=3148.v532a_7e715ee3 +ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" /usr/share/jenkins/agent.jar +RUN chmod 0644 /usr/share/jenkins/agent.jar \ + && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar + +ENV LANG C.UTF-8 + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=jre-build /javaruntime "$JAVA_HOME" +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +USER "${user}" +ENV AGENT_WORKDIR=${AGENT_WORKDIR} +RUN mkdir /home/${user}/.jenkins && mkdir -p "${AGENT_WORKDIR}" + +VOLUME /home/"${user}"/.jenkins +VOLUME "${AGENT_WORKDIR}" +WORKDIR /home/"${user}" +ENV user=${user} +LABEL \ + org.opencontainers.image.vendor="Jenkins project" \ + org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ + org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ + org.opencontainers.image.version="${VERSION}" \ + org.opencontainers.image.url="https://www.jenkins.io/" \ + org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ + org.opencontainers.image.licenses="MIT" diff --git a/docker-bake.hcl b/docker-bake.hcl index ae5a3b016..5922b2af3 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -23,13 +23,14 @@ group "linux-arm32" { targets = [ "debian_jdk11", "debian_jdk17", - "debian_jdk21" + "debian_jdk21_preview" ] } group "linux-s390x" { targets = [ "debian_jdk11", + "debian_jdk21_preview" ] } @@ -37,7 +38,7 @@ group "linux-ppc64le" { targets = [ "debian_jdk11", "debian_jdk17", - "debian_jdk21" + "debian_jdk21_preview" ] } @@ -205,7 +206,6 @@ target "debian_jdk17" { platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/ppc64le"] } - target "debian_jdk21" { dockerfile = "debian/Dockerfile" context = "." @@ -221,5 +221,23 @@ target "debian_jdk21" { "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21", "${REGISTRY}/${JENKINS_REPO}:latest-jdk21", ] - platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/arm/v7"] + platforms = ["linux/amd64", "linux/arm64"] +} + +target "debian_jdk21_preview" { + dockerfile = "debian/21/Dockerfile" + context = "." + args = { + JAVA_VERSION = JAVA21_VERSION + VERSION = REMOTING_VERSION + DEBIAN_RELEASE = DEBIAN_RELEASE + } + tags = [ + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk21-preview" : "", + "${REGISTRY}/${JENKINS_REPO}:bookworm-jdk21-preview", + "${REGISTRY}/${JENKINS_REPO}:jdk21-preview", + "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21-preview", + "${REGISTRY}/${JENKINS_REPO}:latest-jdk21-preview", + ] + platforms = ["linux/ppc64le", "linux/s390x", "linux/arm/v7"] } From d5e7adc262c42b27697128b6a275688627499d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 13:28:21 +0200 Subject: [PATCH 16/27] rename '21' folder to 'preview' --- alpine/preview/Dockerfile | 93 +++++++++++++++++++++++++++++++ debian/{21 => preview}/Dockerfile | 0 2 files changed, 93 insertions(+) create mode 100644 alpine/preview/Dockerfile rename debian/{21 => preview}/Dockerfile (100%) diff --git a/alpine/preview/Dockerfile b/alpine/preview/Dockerfile new file mode 100644 index 000000000..a1b0fde36 --- /dev/null +++ b/alpine/preview/Dockerfile @@ -0,0 +1,93 @@ +ARG ALPINE_TAG=3.18.4 +FROM alpine:"${ALPINE_TAG}" AS jre-build +ARG JAVA_VERSION +ARG TARGETPLATFORM + +# hadolint ignore=DL4006 +RUN apk add --no-cache jq wget \ + && BUILD_NUMBER=$(echo $JAVA_VERSION | cut -d'+' -f2) \ + && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ + && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_alpine-linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".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 + +# 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) +RUN if [ "$TARGETPLATFORM" != 'linux/arm/v7' ]; then \ + case "$(jlink --version 2>&1)" in \ + # jlink version 11 has less features than JDK17+ + "11."*) strip_java_debug_flags="--strip-debug" ;; \ + *) strip_java_debug_flags="--strip-java-debug-attributes" ;; \ + esac; \ + jlink \ + --add-modules ALL-MODULE-PATH \ + "$strip_java_debug_flags" \ + --no-man-pages \ + --no-header-files \ + --compress=zip-6 \ + --output /javaruntime; \ + else \ + cp -r /opt/jdk-${JAVA_VERSION} /javaruntime; \ + fi + +FROM alpine:"${ALPINE_TAG}" AS build + +ARG user=jenkins +ARG group=jenkins +ARG uid=1000 +ARG gid=1000 + +RUN addgroup -g "${gid}" "${group}" \ + && adduser -h /home/"${user}" -u "${uid}" -G "${group}" -D "${user}" + +ARG AGENT_WORKDIR=/home/"${user}"/agent + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' +ENV TZ=Etc/UTC + +## Always use the latest Alpine packages: no need for versions +# hadolint ignore=DL3018 +RUN apk add --no-cache \ + curl \ + bash \ + git \ + git-lfs \ + musl-locales \ + openssh-client \ + openssl \ + procps \ + tzdata \ + tzdata-utils \ + && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/* + +ARG VERSION=3148.v532a_7e715ee3 +ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" /usr/share/jenkins/agent.jar +RUN chmod 0644 /usr/share/jenkins/agent.jar \ + && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar + + +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=jre-build /javaruntime "$JAVA_HOME" +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +USER "${user}" +ENV AGENT_WORKDIR="${AGENT_WORKDIR}" +RUN mkdir /home/"${user}"/.jenkins && mkdir -p "${AGENT_WORKDIR}" + +VOLUME /home/"${user}"/.jenkins +VOLUME "${AGENT_WORKDIR}" +WORKDIR /home/"${user}" +ENV user=${user} +LABEL \ + org.opencontainers.image.vendor="Jenkins project" \ + org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ + org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ + org.opencontainers.image.version="${VERSION}" \ + org.opencontainers.image.url="https://www.jenkins.io/" \ + org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ + org.opencontainers.image.licenses="MIT" diff --git a/debian/21/Dockerfile b/debian/preview/Dockerfile similarity index 100% rename from debian/21/Dockerfile rename to debian/preview/Dockerfile From 5436b8262ff26f78984483f892f9177eb5917610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 13:31:24 +0200 Subject: [PATCH 17/27] restore change --- debian/preview/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/preview/Dockerfile b/debian/preview/Dockerfile index 84cc34444..c289a9024 100644 --- a/debian/preview/Dockerfile +++ b/debian/preview/Dockerfile @@ -60,7 +60,7 @@ RUN apt-get update \ patch \ tzdata \ && apt-get clean \ - && rm -rf /tmp/* /var/cache/* /usr/share/doc/* /usr/share/man/* /var/lib/apt/lists/* + && rm -rf /tmp/* /var/cache/* /var/lib/apt/lists/* ARG VERSION=3148.v532a_7e715ee3 ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" /usr/share/jenkins/agent.jar From 20e4ec8b46ce33b2430451ea7a019ee782fec40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 13:35:00 +0200 Subject: [PATCH 18/27] remove alpine preview version, not needed as its two architectures are provided by the official jdk21 image --- alpine/preview/Dockerfile | 93 --------------------------------------- 1 file changed, 93 deletions(-) delete mode 100644 alpine/preview/Dockerfile diff --git a/alpine/preview/Dockerfile b/alpine/preview/Dockerfile deleted file mode 100644 index a1b0fde36..000000000 --- a/alpine/preview/Dockerfile +++ /dev/null @@ -1,93 +0,0 @@ -ARG ALPINE_TAG=3.18.4 -FROM alpine:"${ALPINE_TAG}" AS jre-build -ARG JAVA_VERSION -ARG TARGETPLATFORM - -# hadolint ignore=DL4006 -RUN apk add --no-cache jq wget \ - && BUILD_NUMBER=$(echo $JAVA_VERSION | cut -d'+' -f2) \ - && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ - && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_alpine-linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".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 - -# 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) -RUN if [ "$TARGETPLATFORM" != 'linux/arm/v7' ]; then \ - case "$(jlink --version 2>&1)" in \ - # jlink version 11 has less features than JDK17+ - "11."*) strip_java_debug_flags="--strip-debug" ;; \ - *) strip_java_debug_flags="--strip-java-debug-attributes" ;; \ - esac; \ - jlink \ - --add-modules ALL-MODULE-PATH \ - "$strip_java_debug_flags" \ - --no-man-pages \ - --no-header-files \ - --compress=zip-6 \ - --output /javaruntime; \ - else \ - cp -r /opt/jdk-${JAVA_VERSION} /javaruntime; \ - fi - -FROM alpine:"${ALPINE_TAG}" AS build - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 - -RUN addgroup -g "${gid}" "${group}" \ - && adduser -h /home/"${user}" -u "${uid}" -G "${group}" -D "${user}" - -ARG AGENT_WORKDIR=/home/"${user}"/agent - -ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -ENV TZ=Etc/UTC - -## Always use the latest Alpine packages: no need for versions -# hadolint ignore=DL3018 -RUN apk add --no-cache \ - curl \ - bash \ - git \ - git-lfs \ - musl-locales \ - openssh-client \ - openssl \ - procps \ - tzdata \ - tzdata-utils \ - && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/* - -ARG VERSION=3148.v532a_7e715ee3 -ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" /usr/share/jenkins/agent.jar -RUN chmod 0644 /usr/share/jenkins/agent.jar \ - && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar - - -ENV JAVA_HOME=/opt/java/openjdk -COPY --from=jre-build /javaruntime "$JAVA_HOME" -ENV PATH="${JAVA_HOME}/bin:${PATH}" - -USER "${user}" -ENV AGENT_WORKDIR="${AGENT_WORKDIR}" -RUN mkdir /home/"${user}"/.jenkins && mkdir -p "${AGENT_WORKDIR}" - -VOLUME /home/"${user}"/.jenkins -VOLUME "${AGENT_WORKDIR}" -WORKDIR /home/"${user}" -ENV user=${user} -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ - org.opencontainers.image.version="${VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ - org.opencontainers.image.licenses="MIT" From db8aadaa1b5a60af389ba6273a0ccd655f1176a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 13:35:19 +0200 Subject: [PATCH 19/27] add distinct JAVA21_PREVIEW_VERSION --- docker-bake.hcl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 5922b2af3..dc3115fb7 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -86,6 +86,10 @@ variable "JAVA21_VERSION" { default = "21_35" } +variable "JAVA21_PREVIEW_VERSION" { + default = "21+35" +} + target "archlinux_jdk11" { dockerfile = "archlinux/Dockerfile" context = "." @@ -228,7 +232,7 @@ target "debian_jdk21_preview" { dockerfile = "debian/21/Dockerfile" context = "." args = { - JAVA_VERSION = JAVA21_VERSION + JAVA_VERSION = JAVA21_PREVIEW_VERSION VERSION = REMOTING_VERSION DEBIAN_RELEASE = DEBIAN_RELEASE } From ca5a30b4e8c36f0b264d7401b3169a1f4d89ca4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 13:36:19 +0200 Subject: [PATCH 20/27] fix jdk21-preview Dockerfile location --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index dc3115fb7..e8dfa3fda 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -229,7 +229,7 @@ target "debian_jdk21" { } target "debian_jdk21_preview" { - dockerfile = "debian/21/Dockerfile" + dockerfile = "debian/preview/Dockerfile" context = "." args = { JAVA_VERSION = JAVA21_PREVIEW_VERSION From 4c508855649d7bf0f5b77ddd699b577d63319102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 14:18:36 +0200 Subject: [PATCH 21/27] add debian_jdk21_preview to the linux targets group --- docker-bake.hcl | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-bake.hcl b/docker-bake.hcl index e8dfa3fda..db5a36c7b 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -7,6 +7,7 @@ group "linux" { "debian_jdk11", "debian_jdk17", "debian_jdk21", + "debian_jdk21_preview" ] } From 0a490c2a1cd6eb4cd6f060b6dd4781336441034a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 15:12:33 +0200 Subject: [PATCH 22/27] apply same fix for preview (EA) release download link as in https://github.com/jenkinsci/docker/pull/1747 --- debian/preview/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/preview/Dockerfile b/debian/preview/Dockerfile index c289a9024..bc00b8e21 100644 --- a/debian/preview/Dockerfile +++ b/debian/preview/Dockerfile @@ -10,11 +10,11 @@ RUN set -x; apt-get update \ ca-certificates \ jq \ wget \ - && BUILD_NUMBER=$(echo $JAVA_VERSION | cut -d'+' -f2) \ + && JAVA_VERSION_DASHED=$(echo $JAVA_VERSION | sed -e 's/\./-/g' -e 's/+/-/') \ && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".tar.gz -O /tmp/jdk.tar.gz \ + && wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${JAVA_VERSION_DASHED}".tar.gz -O /tmp/jdk.tar.gz \ && tar -xzf /tmp/jdk.tar.gz -C /opt/ \ && rm -f /tmp/jdk.tar.gz From f0bfe76df592fac5902426ab749d599b62e43e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 15:19:50 +0200 Subject: [PATCH 23/27] special case for preview (EA) version '21_35', no 'ea_' prefix in this particular version release URL --- debian/preview/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/preview/Dockerfile b/debian/preview/Dockerfile index bc00b8e21..c74b5b3e4 100644 --- a/debian/preview/Dockerfile +++ b/debian/preview/Dockerfile @@ -10,11 +10,11 @@ RUN set -x; apt-get update \ ca-certificates \ jq \ wget \ - && JAVA_VERSION_DASHED=$(echo $JAVA_VERSION | sed -e 's/\./-/g' -e 's/+/-/') \ + && JAVA_VERSION_DASHED=$(echo "ea_${JAVA_VERSION}" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/ea_21_35/21_35/') \ && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${JAVA_VERSION_DASHED}".tar.gz -O /tmp/jdk.tar.gz \ + && wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_"${JAVA_VERSION_DASHED}".tar.gz -O /tmp/jdk.tar.gz \ && tar -xzf /tmp/jdk.tar.gz -C /opt/ \ && rm -f /tmp/jdk.tar.gz From c8ff08711bfb05ac6a1e40170a97d88b9cc21e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 15:21:53 +0200 Subject: [PATCH 24/27] add hadolint ignore DL3008 (no pinned versions with apt-get install) --- debian/preview/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/preview/Dockerfile b/debian/preview/Dockerfile index c74b5b3e4..50b819143 100644 --- a/debian/preview/Dockerfile +++ b/debian/preview/Dockerfile @@ -5,6 +5,7 @@ ARG TARGETPLATFORM SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# hadolint ignore=DL3008 RUN set -x; apt-get update \ && apt-get install --no-install-recommends -y \ ca-certificates \ From 6d78e4bc182902aa97bae37ea25a37f1d960d233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 15:24:39 +0200 Subject: [PATCH 25/27] fix 21_35 special case --- debian/preview/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/preview/Dockerfile b/debian/preview/Dockerfile index 50b819143..59cd45e7e 100644 --- a/debian/preview/Dockerfile +++ b/debian/preview/Dockerfile @@ -11,7 +11,7 @@ RUN set -x; apt-get update \ ca-certificates \ jq \ wget \ - && JAVA_VERSION_DASHED=$(echo "ea_${JAVA_VERSION}" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/ea_21_35/21_35/') \ + && JAVA_VERSION_DASHED=$(echo "ea_${JAVA_VERSION}" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/ea_21-35/21_35/') \ && JAVA_MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'+' -f1) \ && JAVA_VERSION_ENCODED=$(echo "$JAVA_VERSION" | jq "@uri" -jRr) \ && CONVERTED_ARCH=$(arch | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \ From 26d3f88b80de60d01c5bbeaed442dc9028f925cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 15:34:48 +0200 Subject: [PATCH 26/27] same player try again --- debian/preview/Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/preview/Dockerfile b/debian/preview/Dockerfile index 59cd45e7e..19521a507 100644 --- a/debian/preview/Dockerfile +++ b/debian/preview/Dockerfile @@ -5,17 +5,24 @@ ARG TARGETPLATFORM SHELL ["/bin/bash", "-o", "pipefail", "-c"] +## Example of preview (EA) jdk21 JAVA_VERSION values: +# 21+35 +# 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 + # hadolint ignore=DL3008 RUN set -x; apt-get update \ && apt-get install --no-install-recommends -y \ ca-certificates \ jq \ wget \ - && JAVA_VERSION_DASHED=$(echo "ea_${JAVA_VERSION}" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/ea_21-35/21_35/') \ + && JAVA_DASHED_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) \ && JAVA_VERSION_ENCODED=$(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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_"${JAVA_VERSION_DASHED}".tar.gz -O /tmp/jdk.tar.gz \ + && wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${JAVA_DASHED_VERSION}".tar.gz -O /tmp/jdk.tar.gz \ && tar -xzf /tmp/jdk.tar.gz -C /opt/ \ && rm -f /tmp/jdk.tar.gz From db2eb9e082575d653a6f6393238dee21f3900edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 22 Oct 2023 16:17:25 +0200 Subject: [PATCH 27/27] cleanup --- debian/preview/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/preview/Dockerfile b/debian/preview/Dockerfile index 19521a507..225d37332 100644 --- a/debian/preview/Dockerfile +++ b/debian/preview/Dockerfile @@ -6,7 +6,7 @@ ARG TARGETPLATFORM SHELL ["/bin/bash", "-o", "pipefail", "-c"] ## Example of preview (EA) jdk21 JAVA_VERSION values: -# 21+35 +# 21+35 (special case) # 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 @@ -18,11 +18,11 @@ RUN set -x; apt-get update \ ca-certificates \ jq \ wget \ - && JAVA_DASHED_VERSION=$(echo "${JAVA_VERSION}" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \ + && 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) \ - && JAVA_VERSION_ENCODED=$(echo "$JAVA_VERSION" | jq "@uri" -jRr) \ + && 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-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${JAVA_DASHED_VERSION}".tar.gz -O /tmp/jdk.tar.gz \ + && 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