Skip to content

Commit

Permalink
Merge pull request #521 from lemeurherve/jdk21
Browse files Browse the repository at this point in the history
feat(Linux): switch supported architectures to GA Temurin jdk21 images
  • Loading branch information
dduportal authored Oct 22, 2023
2 parents 76351c6 + db2eb9e commit c9614be
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 110 deletions.
93 changes: 0 additions & 93 deletions alpine/21/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions debian/21/Dockerfile → debian/preview/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,24 @@ ARG TARGETPLATFORM

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

## Example of preview (EA) jdk21 JAVA_VERSION values:
# 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
# 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 \
&& BUILD_NUMBER=$(echo $JAVA_VERSION | cut -d'+' -f2) \
&& 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_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-"${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

Expand Down
48 changes: 35 additions & 13 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ group "linux" {
"debian_jdk11",
"debian_jdk17",
"debian_jdk21",
"debian_jdk21_preview"
]
}

Expand All @@ -23,22 +24,22 @@ group "linux-arm32" {
targets = [
"debian_jdk11",
"debian_jdk17",
"debian_jdk21"
"debian_jdk21_preview"
]
}

group "linux-s390x" {
targets = [
"debian_jdk11",
"debian_jdk21"
"debian_jdk21_preview"
]
}

group "linux-ppc64le" {
targets = [
"debian_jdk11",
"debian_jdk17",
"debian_jdk21"
"debian_jdk21_preview"
]
}

Expand Down Expand Up @@ -83,6 +84,10 @@ variable "JAVA17_VERSION" {
}

variable "JAVA21_VERSION" {
default = "21_35"
}

variable "JAVA21_PREVIEW_VERSION" {
default = "21+35"
}

Expand Down Expand Up @@ -149,20 +154,20 @@ target "alpine_jdk17" {
}

target "alpine_jdk21" {
dockerfile = "alpine/21/Dockerfile"
dockerfile = "alpine/Dockerfile"
context = "."
args = {
ALPINE_TAG = ALPINE_FULL_TAG
JAVA_VERSION = JAVA21_VERSION
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"]
}
Expand Down Expand Up @@ -206,21 +211,38 @@ target "debian_jdk17" {
platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/ppc64le"]
}


target "debian_jdk21" {
dockerfile = "debian/21/Dockerfile"
dockerfile = "debian/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" : "",
"${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"]
}

target "debian_jdk21_preview" {
dockerfile = "debian/preview/Dockerfile"
context = "."
args = {
JAVA_VERSION = JAVA21_PREVIEW_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/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "linux/arm/v7"]
platforms = ["linux/ppc64le", "linux/s390x", "linux/arm/v7"]
}

0 comments on commit c9614be

Please sign in to comment.