|
| 1 | +# Zulu build name, e.g. zulu11.54.107-ca-jdk11.0.13 (see java.version) |
1 | 2 | ARG JAVA_VERSION |
2 | 3 | ARG BASE_IMAGE |
3 | | -FROM azul/zulu-openjdk-debian:${JAVA_VERSION} AS jre |
| 4 | +# The azul/zulu-openjdk-debian image has no tag with the eMudhra blocked.certs fix yet, so fetch the |
| 5 | +# Zulu CA build straight from Azul's CDN. The SHA-256 pins the download. jlink copies blocked.certs |
| 6 | +# from the JDK it runs, so it must be the fixed one. |
| 7 | +# TEMP: go back to azul/zulu-openjdk-debian once it publishes a tag with the fix. |
| 8 | +FROM debian:bookworm-slim AS jre |
| 9 | +ARG JAVA_VERSION |
| 10 | +ARG TARGETARCH |
| 11 | +# Update these together with java.version. |
| 12 | +ARG ZULU_SHA256_AMD64=64658a2be5140c2ffd571c0e09ac3b505a2be0d4654e09957b584b54b4dac8b5 |
| 13 | +ARG ZULU_SHA256_ARM64=abed984a694d4da40662ec0bdfd2ecbe798bab1b8ce784d4f02d00479d53e802 |
4 | 14 |
|
5 | 15 | # Needed for --strip-debug |
6 | | -RUN apt-get -y update && apt-get -y upgrade libssl3 && apt-get -y install binutils |
| 16 | +RUN apt-get -y update && apt-get -y upgrade libssl3 && apt-get -y install binutils curl ca-certificates |
| 17 | + |
| 18 | +RUN case "${TARGETARCH}" in \ |
| 19 | + amd64) ZULU_ARCH=x64; ZULU_SHA256="${ZULU_SHA256_AMD64}" ;; \ |
| 20 | + arm64) ZULU_ARCH=aarch64; ZULU_SHA256="${ZULU_SHA256_ARM64}" ;; \ |
| 21 | + *) echo "unsupported arch ${TARGETARCH}" >&2; exit 1 ;; \ |
| 22 | + esac \ |
| 23 | + && curl -fsSL -o /tmp/zulu.tar.gz "https://cdn.azul.com/zulu/bin/${JAVA_VERSION}-linux_${ZULU_ARCH}.tar.gz" \ |
| 24 | + && echo "${ZULU_SHA256} /tmp/zulu.tar.gz" | sha256sum -c - \ |
| 25 | + && mkdir -p /usr/lib/jvm \ |
| 26 | + && tar -xzf /tmp/zulu.tar.gz -C /usr/lib/jvm \ |
| 27 | + && ln -s "/usr/lib/jvm/${JAVA_VERSION}-linux_${ZULU_ARCH}" /usr/lib/jvm/zulu \ |
| 28 | + && rm /tmp/zulu.tar.gz |
| 29 | +ENV JAVA_HOME=/usr/lib/jvm/zulu |
| 30 | +ENV PATH=${JAVA_HOME}/bin:${PATH} |
7 | 31 |
|
8 | 32 | # Included modules cherrypicked from https://docs.oracle.com/en/java/javase/11/docs/api/ |
9 | 33 | # |
@@ -44,6 +68,10 @@ java.net.http,\ |
44 | 68 | jdk.zipfs\ |
45 | 69 | --output jre |
46 | 70 |
|
| 71 | +# Fail the build if the fixed blocklist did not make it through jlink. |
| 72 | +# 7BA62FEC... is one of the fingerprints added by the 2026-10-21 out-of-cycle release. |
| 73 | +RUN grep -q 7BA62FEC54E9D040556FCA70A6A88F03761C178FA1F7CB8390A73076849F55A2 /jre/lib/security/blocked.certs |
| 74 | + |
47 | 75 | # Extract java SSL certs |
48 | 76 | FROM gcr.io/distroless/java-base-debian12:debug AS ssl |
49 | 77 |
|
|
0 commit comments