Skip to content

Commit

Permalink
feat(platforms): Adds ppc64le and s390x archs for JDK21. (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
gounthar committed Sep 13, 2023
1 parent a1fef2f commit b81e9e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
23 changes: 14 additions & 9 deletions debian/21/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BOOKWORM_TAG=20230725
ARG BOOKWORM_TAG=20230904
FROM debian:bookworm-"${BOOKWORM_TAG}"-slim as jre-build
ARG JAVA_VERSION
ARG TARGETPLATFORM
Expand All @@ -13,21 +13,26 @@ RUN set -x; apt-get update \
&& 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/') \
&& 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 jlink \
--add-modules ALL-MODULE-PATH \
--no-man-pages \
--compress=zip-6 \
--output /javaruntime
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:bullseye-20230814 AS build
FROM debian:bookworm-"${BOOKWORM_TAG}" AS build

ARG user=jenkins
ARG group=jenkins
Expand Down
2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,5 @@ target "debian_jdk21" {
"${REGISTRY}/${JENKINS_REPO}:latest-bullseye-jdk21-preview",
"${REGISTRY}/${JENKINS_REPO}:latest-jdk21-preview",
]
platforms = ["linux/amd64", "linux/arm64"]
platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "linux/arm/v7"]
}

0 comments on commit b81e9e0

Please sign in to comment.