Skip to content

Use dpkg-tracked OpenJDK 25 runtime base images - #3280

Merged
CydeWeys merged 1 commit into
google:masterfrom
CydeWeys:dpkg-openjdk25-dockerfiles
Dec 4, 2026
Merged

CydeWeys merged 1 commit into
google:masterfrom
CydeWeys:dpkg-openjdk25-dockerfiles

Conversation

@CydeWeys

@CydeWeys CydeWeys commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

GCP Artifact Analysis cannot natively inventory JVM runtimes in
tarball-based Docker Hub images (eclipse-temurin:25 and
jetty:12-jdk25), leaving OpenJDK CVEs untracked by OS-level scanners
and tying CI builds to Docker Hub pulls. Migrating core, proxy, and
jetty onto a single launcher.gcr.io/google/ubuntu2404 base layer
with openjdk-25-jre-headless installed via apt-get registers the
runtime in /var/lib/dpkg/status for native OS package scanning, shares
a cached JRE layer across all three images, and eliminates floating
Docker Hub tags.

  • Update core/Dockerfile, proxy/Dockerfile, and jetty/Dockerfile
    to use launcher.gcr.io/google/ubuntu2404 with ca-certificates and
    openjdk-25-jre-headless installed via apt-get, preserving existing
    -XX:-UseBASE64Intrinsics flags.
  • Stage Jetty Home through Gradle instead of downloading it inside
    jetty/Dockerfile. Declare org.eclipse.jetty:jetty-home in
    dependencies.gradle and lock
    org.eclipse.jetty:jetty-home:12.1.15=jettyHome in
    jetty/gradle.lockfile (matching Jetty 12.1.15 elsewhere). Add the
    :jetty:unpackJettyHome task to unpack it into build/jetty-home
    during :jetty:stage, and fall back to build/jetty-home in
    :jetty:run when JETTY_HOME is unset.
  • Install the Cloud Profiler Java agent under a dedicated non-root
    jetty:jetty user in jetty/Dockerfile, preserving all runtime paths
    and permissions.
  • Update release/prepare_release_tree.sh,
    release/cloudbuild-release.yaml,
    release/cloudbuild-nomulus-images.yaml, and
    release/cloudbuild-proxy-images.yaml to mirror and digest-pin the
    shared ubuntu2404 base image across core, proxy, and jetty.
  • Add release/prepare_release_tree_test.sh and wire it into
    config/presubmits.py.

BUG= http://b/587432676


This change is Reviewable

Comment thread jetty/Dockerfile Resolved
@CydeWeys

Copy link
Copy Markdown
Member Author

Is this overall more maintainable and the more supported, well-lit path for how to handle these containers generally?

@CydeWeys

Copy link
Copy Markdown
Member Author

Is this overall more maintainable and the more supported, well-lit path for
how to handle these containers generally?

Candidly: compared to where we were (eclipse-temurin:25 + jetty:12-jdk25
from Docker Hub), yes; compared to the broader GCP/GKE Java ecosystem, this is
a pragmatic middle ground rather than the canonical endgame.
Here is how the
options compare in practice:

1. Why this PR is a step forward over eclipse-temurin + jetty

  • OS scanner visibility: Official eclipse-temurin and jetty images
    unpack JDK tarballs under /opt/java/openjdk outside dpkg, leaving the JVM
    invisible to OS package scanners like GCP Artifact Analysis. Installing
    openjdk-25-jre-headless via apt registers the Ubuntu security-patched
    package in /var/lib/dpkg/status (and drops the full JDK toolchain down to a
    headless JRE).
  • Single first-party base: All three runtime images (nomulus, proxy,
    nomulus-tool) now share launcher.gcr.io/google/ubuntu2404 (already used by
    release/builder) instead of pulling two third-party Docker Hub images
    subject to pull rate limits and floating tag rebuilds.

2. What the canonical "well-lit path" on GCP looks like (Distroless + Jib)

For Java services on GKE generally, Google's most well-lit path is Jib
(com.google.cloud.tools.jib) + Distroless
:

  • Java 25 availability today: gcr.io/distroless/java25-debian13:nonroot
    (aliased as gcr.io/distroless/java25:nonroot) is live now (java25-debian12
    does not exist; the java25 track started on Debian 13 and bundles Eclipse
    Adoptium's temurin-25-jre .deb plus libc6/libstdc++6 across just 23
    total packages recorded in /var/lib/dpkg/status.d/).
  • Pros: Strips bash, apt, and ~85% of OS userland packages (dramatically
    cutting unrelated OS CVE noise), retains /var/lib/dpkg/status.d/ metadata
    for Artifact Analysis, and builds deterministic layered images directly from
    Gradle without a Docker daemon or build-time apt-get network calls.
  • Caveats for Nomulus:
    • proxy and nomulus-tool (core): Pure java -jar entrypoints
      (java25-debian13 already includes libc6/libstdc++6 for proxy's
      netty-tcnative-boringssl-static), so both could adopt Jib + Distroless
      cleanly.
    • nomulus (jetty): Currently invokes /bin/bash /start.sh (cp,
      find, rm) at startup to stage webapps/console-${env} into
      webapps/console and attach /opt/cprof/profiler_java_agent.so.
      Distroless has no shell, so moving nomulus to Distroless would first
      require moving environment console selection out of start.sh into
      Java/Jetty configuration (and staging the profiler .so at build time).
    • Scanner nuance: Because distroless/java25-debian13 ships Adoptium's
      temurin-25-jre package rather than Debian's native openjdk-25 package,
      it relies on scanner support for Adoptium/Java binary metadata rather than
      Canonical/Debian's native openjdk-25 OS USN feed.

3. Two concrete refinements if we keep ubuntu2404 + openjdk-25-jre

If we stay on ubuntu2404 (either for operational uniformity across all three
services + builder, or while jetty still uses start.sh), two follow-ups
would remove the remaining rough edges in this PR:

  1. Build and digest-pin one shared jre-base image in
    cloudbuild-release.yaml:
    Right now, core, proxy, and jetty each run
    apt-get update && apt-get upgrade -y && apt-get install ... openjdk-25-jre-headless independently during image builds. Building a single
    release/jre-base/Dockerfile once per release (just like release/builder),
    pushing gcr.io/${PROJECT_ID}/jre-base:${TAG_NAME}, and digest-pinning all
    three service Dockerfiles to jre-base@sha256:... eliminates 3x duplicated
    apt runs and guarantees bit-for-bit identical OS/JRE packages across the
    release without live apt mirror drift.
  2. Stage jetty-home via Gradle (dependencies.gradle): As noted on the
    jetty/Dockerfile thread, unpacking org.eclipse.jetty:jetty-home in Gradle
    eliminates JETTY_VERSION/JETTY_SHA256 drift and removes the build-time
    repo1.maven.org fetch.

Recommendation

  • Near term: Keep the unified ubuntu2404 + openjdk-25-jre-headless
    direction to unblock OS-level JVM scanning immediately, and follow up with
    (1) Gradle-staged jetty-home and (2) a single release-pinned
    jre-base image
    .
  • Longer term: If we want minimal OS CVE surface and daemonless builds,
    migrate proxy and nomulus-tool to Jib +
    gcr.io/distroless/java25-debian13:nonroot first, then follow with nomulus
    once start.sh's console-${env} directory shuffle is replaced in Java.

@CydeWeys
CydeWeys force-pushed the dpkg-openjdk25-dockerfiles branch from d616b79 to eb7e9c0 Compare November 19, 2026 00:09

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Attention Required: Lockfile Detected

This pull request contains modifications to one or more *.lockfile files. Please confirm that you have run update_dependency.sh to push new dependencies to the private repo.

Someone with Admin role must manually dismiss this review before merging.

@CydeWeys
CydeWeys requested a review from jicelhay November 20, 2026 22:04
@CydeWeys
CydeWeys force-pushed the dpkg-openjdk25-dockerfiles branch from eb7e9c0 to e1475b7 Compare November 27, 2026 20:27

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Attention Required: Lockfile Detected

This pull request contains modifications to one or more *.lockfile files. Please confirm that you have run update_dependency.sh to push new dependencies to the private repo.

Someone with Admin role must manually dismiss this review before merging.

@CydeWeys
CydeWeys dismissed stale reviews from github-actions[bot] and github-actions[bot] November 27, 2026 20:49

Verified org.eclipse.jetty:jetty-home:12.1.15 is present in gs://domain-registry-maven-repository and synced lockfile metadata to sso://team/domain-registry-eng/nomulus_dependencies via update_dependency.sh.

@jicelhay jicelhay left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jicelhay reviewed 12 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on CydeWeys).

github-actions[bot]

This comment was marked as resolved.

@CydeWeys
CydeWeys enabled auto-merge December 4, 2026 20:07
GCP Artifact Analysis cannot natively inventory JVM runtimes in
tarball-based Docker Hub images (eclipse-temurin:25 and jetty:12-jdk25),
leaving OpenJDK CVEs untracked by OS-level scanners and tying CI builds
to Docker Hub pulls. Migrating core, proxy, and jetty onto a single
launcher.gcr.io/google/ubuntu2404 base layer with
openjdk-25-jre-headless installed via apt-get registers the runtime in
/var/lib/dpkg/status for native OS package scanning, shares a cached
JRE layer across all three images, and eliminates floating Docker Hub
tags.

- Update core/Dockerfile, proxy/Dockerfile, and jetty/Dockerfile to use
  launcher.gcr.io/google/ubuntu2404 with ca-certificates and
  openjdk-25-jre-headless installed via apt-get, preserving existing
  -XX:-UseBASE64Intrinsics flags.
- Stage Jetty Home through Gradle instead of downloading it inside
  jetty/Dockerfile. Declare org.eclipse.jetty:jetty-home in
  dependencies.gradle and lock org.eclipse.jetty:jetty-home:12.1.15 in
  jetty/gradle.lockfile (matching Jetty 12.1.15 elsewhere). Add the
  :jetty:unpackJettyHome task to unpack it into build/jetty-home during
  :jetty:stage, and fall back to build/jetty-home in :jetty:run when
  JETTY_HOME is unset.
- Install the Cloud Profiler Java agent under a dedicated non-root
  jetty:jetty user in jetty/Dockerfile, preserving all runtime paths
  and permissions.
- Update release/prepare_release_tree.sh,
  release/cloudbuild-release.yaml,
  release/cloudbuild-nomulus-images.yaml, and
  release/cloudbuild-proxy-images.yaml to mirror and digest-pin the
  shared ubuntu2404 base image across core, proxy, and jetty.
- Add release/prepare_release_tree_test.sh and wire it into
  config/presubmits.py.

BUG= http://b/587432676
@CydeWeys
CydeWeys force-pushed the dpkg-openjdk25-dockerfiles branch from 4d12a3d to bbbd260 Compare December 4, 2026 20:39

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Attention Required: Lockfile Detected

This pull request contains modifications to one or more *.lockfile files. Please confirm that you have run update_dependency.sh to push new dependencies to the private repo.

Someone with Admin role must manually dismiss this review before merging.

@CydeWeys
CydeWeys dismissed stale reviews from github-actions[bot] and github-actions[bot] December 4, 2026 20:47

Verified org.eclipse.jetty:jetty-home:12.1.15 is synced to gcs://domain-registry-maven-repository/maven and built cleanly offline.

@CydeWeys
CydeWeys added this pull request to the merge queue Dec 4, 2026
Merged via the queue into google:master with commit b076084 Dec 4, 2026
15 of 16 checks passed
@CydeWeys
CydeWeys deleted the dpkg-openjdk25-dockerfiles branch December 4, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants