From 194bbe12332037627bb6398e42b7b380841675cb Mon Sep 17 00:00:00 2001 From: "Marvin A. Ruder" Date: Thu, 16 Nov 2023 21:26:01 +0100 Subject: [PATCH 1/4] Use generally available JDK21 images * Create separate `-preview` configurations for architectures in early access * Fix early access URLs * Switch to Ubuntu 22.04 LTS build images * Fix `make` command in README.md Signed-off-by: Marvin A. Ruder --- README.md | 2 +- alpine/{21 => preview}/Dockerfile | 11 +-- debian/Dockerfile | 2 +- debian/{21 => preview}/Dockerfile | 7 +- docker-bake.hcl | 60 ++++++++++++++-- updatecli/scripts/check-jdk.sh | 7 +- updatecli/updatecli.d/jdk11.yaml | 4 +- updatecli/updatecli.d/jdk17.yaml | 4 +- updatecli/updatecli.d/jdk21-preview.yaml | 75 ++++++++++++++++++++ updatecli/updatecli.d/jdk21.yaml | 89 ++++++++++++++++-------- 10 files changed, 207 insertions(+), 54 deletions(-) rename alpine/{21 => preview}/Dockerfile (93%) rename debian/{21 => preview}/Dockerfile (95%) create mode 100644 updatecli/updatecli.d/jdk21-preview.yaml diff --git a/README.md b/README.md index 88847609..f70dce0f 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ make build-_ That would give for JDK 11 on Alpine Linux: ```bash -make test-alpine_jdk11 +make build-alpine_jdk11 ``` #### Building all images diff --git a/alpine/21/Dockerfile b/alpine/preview/Dockerfile similarity index 93% rename from alpine/21/Dockerfile rename to alpine/preview/Dockerfile index b45a9109..1cbd0950 100644 --- a/alpine/21/Dockerfile +++ b/alpine/preview/Dockerfile @@ -19,16 +19,17 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -ARG ALPINE_TAG=3.18.3 +ARG ALPINE_TAG=3.18.4 FROM alpine:"${ALPINE_TAG}" AS jre-build -ARG JAVA_VERSION=21+35 +ARG JAVA_VERSION=21.0.1+12 RUN apk add --no-cache curl jq \ - && ARCH=$(uname -m | sed 's/x86_64/x64/') \ + && ARCH=$(uname -m | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \ && JAVA_VERSION_ENCODED=$(printf '%s' "$JAVA_VERSION" | jq -jRr '@uri') \ && BUILD_NUMBER=$(printf '%s' "$JAVA_VERSION" | cut -d'+' -f2) \ - && JAVA_MAJOR_VERSION=$(printf '%s' "$JAVA_VERSION" | cut -d'+' -f1) \ - && curl -sL https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${ARCH}"_alpine-linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".tar.gz | tar xz -C /opt/ + && JAVA_MAJOR_VERSION=$(printf '%s' "$JAVA_VERSION" | cut -d'.' -f1) \ + && JAVA_VERSION_KEBAB=$(printf '%s' "$JAVA_VERSION" | sed 's/+/-/g;s/\./-/g') \ + && curl -sL https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${ARCH}"_alpine-linux_hotspot_ea_"${JAVA_VERSION_KEBAB}".tar.gz | tar xz -C /opt/ ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH diff --git a/debian/Dockerfile b/debian/Dockerfile index ae7be241..994aae57 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -1,6 +1,6 @@ ARG JAVA_VERSION=17.0.8.1_1 ARG DEBIAN_RELEASE=bookworm-20231030 -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/debian/21/Dockerfile b/debian/preview/Dockerfile similarity index 95% rename from debian/21/Dockerfile rename to debian/preview/Dockerfile index 30abd792..c4c677a5 100644 --- a/debian/21/Dockerfile +++ b/debian/preview/Dockerfile @@ -1,6 +1,6 @@ ARG DEBIAN_RELEASE=bookworm-20230904 FROM debian:"${DEBIAN_RELEASE}" AS jre-build -ARG JAVA_VERSION=21+35 +ARG JAVA_VERSION=21.0.1+12 # This Build ARG is populated by Docker # Ref. https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope ARG TARGETPLATFORM @@ -12,8 +12,9 @@ RUN apt-get update \ && ARCH=$(uname -m | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \ && JAVA_VERSION_ENCODED=$(printf '%s' "$JAVA_VERSION" | jq -jRr '@uri') \ && BUILD_NUMBER=$(printf '%s' "$JAVA_VERSION" | cut -d'+' -f2) \ - && JAVA_MAJOR_VERSION=$(printf '%s' "$JAVA_VERSION" | cut -d'+' -f1) \ - && curl -sL https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${ARCH}"_linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".tar.gz | tar xz -C /opt/ \ + && JAVA_MAJOR_VERSION=$(printf '%s' "$JAVA_VERSION" | cut -d'.' -f1) \ + && JAVA_VERSION_KEBAB=$(printf '%s' "$JAVA_VERSION" | sed 's/+/-/g;s/\./-/g') \ + && curl -sL https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${ARCH}"_linux_hotspot_ea_"${JAVA_VERSION_KEBAB}".tar.gz | tar xz -C /opt/ \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/docker-bake.hcl b/docker-bake.hcl index c2ac1b85..54fd1fdd 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -3,8 +3,10 @@ group "linux" { "alpine_jdk11", "alpine_jdk17", "alpine_jdk21", + "alpine_jdk21-preview", "debian_jdk11", "debian_jdk21", + "debian_jdk21-preview", ] } @@ -19,19 +21,22 @@ group "linux-arm64" { group "linux-arm32" { targets = [ - "debian_jdk21", + "alpine_jdk21-preview", + "debian_jdk21-preview", ] } group "linux-s390x" { targets = [ + "alpine_jdk21-preview", "debian_jdk11", - "debian_jdk21" + "debian_jdk21-preview" ] } group "linux-ppc64le" { targets = [ + "alpine_jdk21-preview", "debian_jdk11", "debian_jdk17", "debian_jdk21" @@ -71,7 +76,11 @@ variable "JAVA17_VERSION" { } variable "JAVA21_VERSION" { - default = "21+35" + default = "21.0.1_12" +} + +variable "JAVA21_PREVIEW_VERSION" { + default = "21.0.1+12" } variable "DEBIAN_RELEASE" { @@ -118,12 +127,30 @@ target "alpine_jdk17" { } target "alpine_jdk21" { - dockerfile = "alpine/21/Dockerfile" + dockerfile = "alpine/Dockerfile" context = "." args = { ALPINE_TAG = ALPINE_FULL_TAG JAVA_VERSION = JAVA21_VERSION } + tags = [ + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine-jdk21" : "", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine${ALPINE_SHORT_TAG}-jdk21" : "", + "${REGISTRY}/${JENKINS_REPO}:alpine-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk21", + "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk21", + ] + platforms = ["linux/amd64", "linux/arm64"] +} + +target "alpine_jdk21-preview" { + dockerfile = "alpine/preview/Dockerfile" + context = "." + args = { + ALPINE_TAG = ALPINE_FULL_TAG + JAVA_VERSION = JAVA21_PREVIEW_VERSION + } tags = [ equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine-jdk21-preview" : "", equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine${ALPINE_SHORT_TAG}-jdk21-preview" : "", @@ -132,7 +159,7 @@ target "alpine_jdk21" { "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk21-preview", "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk21-preview", ] - platforms = ["linux/amd64", "linux/arm64"] + platforms = ["linux/ppc64le", "linux/s390x", "linux/arm/v7"] } target "debian_jdk11" { @@ -176,12 +203,31 @@ target "debian_jdk17" { } target "debian_jdk21" { - dockerfile = "debian/21/Dockerfile" + dockerfile = "debian/Dockerfile" context = "." args = { JAVA_VERSION = JAVA21_VERSION DEBIAN_RELEASE = DEBIAN_RELEASE } + tags = [ + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-jdk21" : "", + "${REGISTRY}/${JENKINS_REPO}:bookworm-jdk21", + "${REGISTRY}/${JENKINS_REPO}:debian-jdk21", + "${REGISTRY}/${JENKINS_REPO}:jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-debian-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-jdk21", + ] + platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le"] +} + +target "debian_jdk21-preview" { + dockerfile = "debian/preview/Dockerfile" + context = "." + args = { + JAVA_VERSION = JAVA21_PREVIEW_VERSION + DEBIAN_RELEASE = DEBIAN_RELEASE + } tags = [ equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-jdk21-preview" : "", "${REGISTRY}/${JENKINS_REPO}:bookworm-jdk21-preview", @@ -191,5 +237,5 @@ target "debian_jdk21" { "${REGISTRY}/${JENKINS_REPO}:latest-debian-jdk21-preview", "${REGISTRY}/${JENKINS_REPO}:latest-jdk21-preview", ] - platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "linux/arm/v7"] + platforms = ["linux/s390x", "linux/arm/v7"] } diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index e941cf14..9d815a79 100755 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -30,10 +30,11 @@ 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 + # TODO: Check both generally available and early access versions, as both are in use within this repository + # JDK version (21.0.1+12-ea-beta) + ## https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_aarch64_linux_hotspot_ea_21-0-1-12.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)" + echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}-ea-beta/OpenJDK21U-jdk_${platform}_hotspot_ea_$(echo ${jdk_version} | sed 's/+/-/g;s/\./-/g')" return 0;; *) echo "ERROR: unsupported JDK version (${jdk_version})."; diff --git a/updatecli/updatecli.d/jdk11.yaml b/updatecli/updatecli.d/jdk11.yaml index 7dd6343f..2ff968b3 100644 --- a/updatecli/updatecli.d/jdk11.yaml +++ b/updatecli/updatecli.d/jdk11.yaml @@ -44,7 +44,7 @@ conditions: tag: '{{source "jdk11LastVersion" }}-jdk-alpine' checkTemurinJDK11DebianDockerImages: kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-focal" is available + name: Check if the container image "eclipse-temurin:-jdk-jammy" is available disablesourceinput: true spec: architectures: @@ -53,7 +53,7 @@ conditions: - s390x - arm/v7 image: eclipse-temurin - tag: '{{source "jdk11LastVersion" }}-jdk-focal' + tag: '{{source "jdk11LastVersion" }}-jdk-jammy' checkTemurinJDK11WindowsCoreDockerImage: kind: dockerimage name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available diff --git a/updatecli/updatecli.d/jdk17.yaml b/updatecli/updatecli.d/jdk17.yaml index 6e2df0c8..ee3ef991 100644 --- a/updatecli/updatecli.d/jdk17.yaml +++ b/updatecli/updatecli.d/jdk17.yaml @@ -44,7 +44,7 @@ conditions: tag: '{{source "jdk17LastVersion" }}-jdk-alpine' checkTemurinJDK17DebianDockerImages: kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-focal" is available + name: Check if the container image "eclipse-temurin:-jdk-jammy" is available disablesourceinput: true spec: architectures: @@ -53,7 +53,7 @@ conditions: - s390x - arm/v7 image: eclipse-temurin - tag: '{{source "jdk17LastVersion" }}-jdk-focal' + tag: '{{source "jdk17LastVersion" }}-jdk-jammy' checkTemurinJDK17WindowsCoreDockerImage: kind: dockerimage name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available diff --git a/updatecli/updatecli.d/jdk21-preview.yaml b/updatecli/updatecli.d/jdk21-preview.yaml new file mode 100644 index 00000000..5da96c27 --- /dev/null +++ b/updatecli/updatecli.d/jdk21-preview.yaml @@ -0,0 +1,75 @@ +--- +name: Bump JDK21 EA version 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: + getLatestJDK21EAVersion: + name: Get the latest Adoptium JDK21 EA version + 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 + +targets: + setJDK21VersionForBake: + name: "Bump JDK21 EA version for Linux images in the docker-bake.hcl file" + kind: hcl + spec: + file: docker-bake.hcl + path: variable.JAVA21_PREVIEW_VERSION.default + scmid: default + setJDK21VersionAlpine: + name: "Bump JDK21 EA version for Linux images in the Alpine Linux Dockerfile" + kind: dockerfile + spec: + file: alpine/preview/Dockerfile + instruction: + keyword: "ARG" + matcher: "JAVA_VERSION" + setJDK21VersionDebian: + name: "Bump JDK21 EA version for Linux images in the Debian Dockerfile" + kind: dockerfile + spec: + file: debian/preview/Dockerfile + instruction: + keyword: "ARG" + matcher: "JAVA_VERSION" +actions: + default: + kind: github/pullrequest + scmid: default + title: Bump JDK21 EA version to {{ source "getLatestJDK21EAVersion" }} + spec: + labels: + - dependencies \ No newline at end of file diff --git a/updatecli/updatecli.d/jdk21.yaml b/updatecli/updatecli.d/jdk21.yaml index 4a7cb402..23c61f21 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 Temurin's JDK21 version scms: default: @@ -12,64 +12,93 @@ 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: - getLatestJDK21EAVersion: - name: Get the latest Adoptium JDK21 version - kind: gittag - scmid: temurin21-binaries + jdk21LastVersion: + kind: githubrelease + name: Get the latest Temurin JDK21 version spec: + owner: "adoptium" + repository: "temurin21-binaries" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" versionfilter: kind: regex - pattern: ".*-ea-.*" + # jdk-17.0.2+8(https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.2%2B8) is OK + # jdk-17.0.4.1+1(https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.4.1%2B1) is OK + pattern: "^jdk-21.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$" transformers: - trimprefix: "jdk-" - - trimsuffix: "-ea-beta" + - replacer: + from: + + to: _ conditions: - checkIfReleaseIsAvailable: - kind: shell + checkTemurinJDK21AlpineDockerImage: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-alpine" is available + disablesourceinput: true + spec: + architecture: amd64 + image: eclipse-temurin + tag: '{{source "jdk21LastVersion" }}-jdk-alpine' + checkTemurinJDK21DebianDockerImages: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-jammy" is available + disablesourceinput: true + spec: + architectures: + - amd64 + - arm64 + - s390x + - arm/v7 + image: eclipse-temurin + tag: '{{source "jdk21LastVersion" }}-jdk-jammy' + checkTemurinJDK21WindowsCoreDockerImage: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available + disablesourceinput: true spec: - command: bash ./updatecli/scripts/check-jdk.sh # source input value passed as argument + architecture: amd64 + image: eclipse-temurin + tag: '{{source "jdk21LastVersion" }}-jdk-windowsservercore-1809' targets: - setJDK21VersionForBake: + setJDK21VersionDockerBake: name: "Bump JDK21 version for Linux images in the docker-bake.hcl file" kind: hcl + sourceid: jdk21LastVersion spec: file: docker-bake.hcl path: variable.JAVA21_VERSION.default scmid: default setJDK21VersionAlpine: - name: "Bump JDK21 version for Linux images in the Alpine Linux Dockerfile" + name: "Bump JDK21 default ARG version on Alpine Dockerfile" kind: dockerfile + sourceid: jdk21LastVersion spec: - file: alpine/21/Dockerfile + file: alpine/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" + name: "Bump JDK21 default ARG version on Debian Dockerfile" kind: dockerfile + sourceid: jdk21LastVersion spec: - file: debian/21/Dockerfile + file: debian/Dockerfile instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" + keyword: ARG + matcher: JAVA_VERSION + scmid: default + actions: default: kind: github/pullrequest scmid: default - title: Bump JDK21 version to {{ source "getLatestJDK21EAVersion" }} + title: Bump JDK21 version to {{ source "jdk21LastVersion" }} spec: labels: - - dependencies \ No newline at end of file + - dependencies + - jdk21 From 37351158eb43aeb99834d8d1d563a8b2e3ffa292 Mon Sep 17 00:00:00 2001 From: "Marvin A. Ruder" Date: Thu, 16 Nov 2023 21:45:43 +0100 Subject: [PATCH 2/4] Remove arm32 architecture from JDK21 configuration Signed-off-by: Marvin A. Ruder --- docker-bake.hcl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 54fd1fdd..67e70cde 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -21,7 +21,6 @@ group "linux-arm64" { group "linux-arm32" { targets = [ - "alpine_jdk21-preview", "debian_jdk21-preview", ] } @@ -159,7 +158,7 @@ target "alpine_jdk21-preview" { "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk21-preview", "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk21-preview", ] - platforms = ["linux/ppc64le", "linux/s390x", "linux/arm/v7"] + platforms = ["linux/ppc64le", "linux/s390x"] } target "debian_jdk11" { From 00a72063c45a623adc59cda55ba5386f89fb03c6 Mon Sep 17 00:00:00 2001 From: "Marvin A. Ruder" Date: Thu, 16 Nov 2023 21:55:26 +0100 Subject: [PATCH 3/4] Remove setup for `alpine_jdk21-preview` Signed-off-by: Marvin A. Ruder --- alpine/preview/Dockerfile | 121 ----------------------- docker-bake.hcl | 20 ---- updatecli/updatecli.d/jdk21-preview.yaml | 8 -- 3 files changed, 149 deletions(-) delete mode 100644 alpine/preview/Dockerfile diff --git a/alpine/preview/Dockerfile b/alpine/preview/Dockerfile deleted file mode 100644 index 1cbd0950..00000000 --- a/alpine/preview/Dockerfile +++ /dev/null @@ -1,121 +0,0 @@ -# MIT License -# -# Copyright (c) 2019-2022 Fabio Kruger and other contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -ARG ALPINE_TAG=3.18.4 -FROM alpine:"${ALPINE_TAG}" AS jre-build -ARG JAVA_VERSION=21.0.1+12 - -RUN apk add --no-cache curl jq \ - && ARCH=$(uname -m | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \ - && JAVA_VERSION_ENCODED=$(printf '%s' "$JAVA_VERSION" | jq -jRr '@uri') \ - && BUILD_NUMBER=$(printf '%s' "$JAVA_VERSION" | cut -d'+' -f2) \ - && JAVA_MAJOR_VERSION=$(printf '%s' "$JAVA_VERSION" | cut -d'.' -f1) \ - && JAVA_VERSION_KEBAB=$(printf '%s' "$JAVA_VERSION" | sed 's/+/-/g;s/\./-/g') \ - && curl -sL https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${ARCH}"_alpine-linux_hotspot_ea_"${JAVA_VERSION_KEBAB}".tar.gz | tar xz -C /opt/ - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -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=2 \ - --output /javaruntime; \ - else \ - cp -r /opt/java/openjdk /javaruntime; \ - fi - -FROM alpine:"${ALPINE_TAG}" AS build - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG JENKINS_AGENT_HOME=/home/${user} - -ENV JENKINS_AGENT_HOME=${JENKINS_AGENT_HOME} - -ARG AGENT_WORKDIR="${JENKINS_AGENT_HOME}"/agent -# Persist agent workdir path through an environment variable for people extending the image -ENV AGENT_WORKDIR=${AGENT_WORKDIR} - -RUN addgroup -g "${gid}" "${group}" \ - # Set the home directory (h), set user and group id (u, G), set the shell, don't ask for password (D) - && adduser -h "${JENKINS_AGENT_HOME}" -u "${uid}" -G "${group}" -s /bin/bash -D "${user}" \ - # Unblock user - && passwd -u "${user}" \ - # Prepare subdirectories - && mkdir -p "${JENKINS_AGENT_HOME}/.ssh/" "${JENKINS_AGENT_HOME}/.jenkins/" "${AGENT_WORKDIR}" \ - && chown -R "${uid}":"${gid}" "${JENKINS_AGENT_HOME}" "${AGENT_WORKDIR}" - - -RUN apk add --no-cache \ - bash \ - git-lfs \ - less \ - musl-locales \ - netcat-openbsd \ - openssh \ - patch - -# setup SSH server -RUN sed -i /etc/ssh/sshd_config \ - -e 's/#PermitRootLogin.*/PermitRootLogin no/' \ - -e 's/#PasswordAuthentication.*/PasswordAuthentication no/' \ - -e 's/#SyslogFacility.*/SyslogFacility AUTH/' \ - -e 's/#LogLevel.*/LogLevel INFO/' \ - -e 's/#PermitUserEnvironment.*/PermitUserEnvironment yes/' \ - && mkdir /var/run/sshd - -# Install JDK - -ENV JAVA_HOME=/opt/java/openjdk -COPY --from=jre-build /javaruntime "$JAVA_HOME" -ENV PATH="${JAVA_HOME}/bin:${PATH}" - -# VOLUME directive must happen after setting up permissions and content -VOLUME "${AGENT_WORKDIR}" "${JENKINS_AGENT_HOME}"/.jenkins "/tmp" "/run" "/var/run" -WORKDIR "${JENKINS_AGENT_HOME}" - -# Alpine's ssh doesn't use $PATH defined in /etc/environment, so we define `$PATH` in `~/.ssh/environment` -# The file path has been created earlier in the file by `mkdir -p` and we also have configured sshd so that it will -# allow environment variables to be sourced (see `sed` command related to `PermitUserEnvironment`) -RUN echo "PATH=${PATH}" >> ${JENKINS_AGENT_HOME}/.ssh/environment -COPY setup-sshd /usr/local/bin/setup-sshd - -EXPOSE 22 - -ENTRYPOINT ["setup-sshd"] - -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins SSH Agent Docker image" \ - org.opencontainers.image.description="A Jenkins agent image which allows using SSH to establish the connection" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-ssh-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/docker-bake.hcl b/docker-bake.hcl index 67e70cde..a1a86069 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -27,7 +27,6 @@ group "linux-arm32" { group "linux-s390x" { targets = [ - "alpine_jdk21-preview", "debian_jdk11", "debian_jdk21-preview" ] @@ -35,7 +34,6 @@ group "linux-s390x" { group "linux-ppc64le" { targets = [ - "alpine_jdk21-preview", "debian_jdk11", "debian_jdk17", "debian_jdk21" @@ -143,24 +141,6 @@ target "alpine_jdk21" { platforms = ["linux/amd64", "linux/arm64"] } -target "alpine_jdk21-preview" { - dockerfile = "alpine/preview/Dockerfile" - context = "." - args = { - ALPINE_TAG = ALPINE_FULL_TAG - JAVA_VERSION = JAVA21_PREVIEW_VERSION - } - tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine-jdk21-preview" : "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine${ALPINE_SHORT_TAG}-jdk21-preview" : "", - "${REGISTRY}/${JENKINS_REPO}:alpine-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk21-preview", - ] - platforms = ["linux/ppc64le", "linux/s390x"] -} - target "debian_jdk11" { dockerfile = "debian/Dockerfile" context = "." diff --git a/updatecli/updatecli.d/jdk21-preview.yaml b/updatecli/updatecli.d/jdk21-preview.yaml index 5da96c27..fe0df376 100644 --- a/updatecli/updatecli.d/jdk21-preview.yaml +++ b/updatecli/updatecli.d/jdk21-preview.yaml @@ -49,14 +49,6 @@ targets: file: docker-bake.hcl path: variable.JAVA21_PREVIEW_VERSION.default scmid: default - setJDK21VersionAlpine: - name: "Bump JDK21 EA version for Linux images in the Alpine Linux Dockerfile" - kind: dockerfile - spec: - file: alpine/preview/Dockerfile - instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" setJDK21VersionDebian: name: "Bump JDK21 EA version for Linux images in the Debian Dockerfile" kind: dockerfile From 5c6b816ea298a93dacf35c5f8d010e6984077f23 Mon Sep 17 00:00:00 2001 From: "Marvin A. Ruder" Date: Thu, 16 Nov 2023 22:02:25 +0100 Subject: [PATCH 4/4] Remove `alpine_jdk21-preview` Signed-off-by: Marvin A. Ruder --- docker-bake.hcl | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index a1a86069..ba843490 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -3,7 +3,6 @@ group "linux" { "alpine_jdk11", "alpine_jdk17", "alpine_jdk21", - "alpine_jdk21-preview", "debian_jdk11", "debian_jdk21", "debian_jdk21-preview",