Skip to content

KAFKA-20857: Use Java 25 in Docker images - #23063

Open
lh0156 wants to merge 2 commits into
apache:trunkfrom
lh0156:agent/KAFKA-20857-java25-docker
Open

KAFKA-20857: Use Java 25 in Docker images#23063
lh0156 wants to merge 2 commits into
apache:trunkfrom
lh0156:agent/KAFKA-20857-java25-docker

Conversation

@lh0156

@lh0156 lh0156 commented Aug 3, 2026

Copy link
Copy Markdown

What

Update the JVM and native Docker build images to Java 25, the latest LTS supported by Kafka.

  • Use Eclipse Temurin 25 JRE Alpine for JVM image build and runtime stages.
  • Use GraalVM Community 25 for native-image compilation.
  • Stop the JVM used for dynamic CDS generation by its captured PID so the JSA archive is generated reliably despite long classpaths being truncated by process discovery.

Testing

  • ./gradlew releaseTarGz --no-build-cache --console=plain
  • JVM Docker build stage and final image build with Java 25 passed.
  • JVM JSA generation exercised Kafka startup, topic creation, produce, consume, and graceful shutdown; both kafka.jsa and storage.jsa were produced.
  • JVM image smoke test: kafka-topics.sh --version -> 4.4.0-SNAPSHOT.
  • GraalVM Community 25 native-image build and final image build passed.
  • Native image smoke test: kafka.Kafka --help.
  • bash -n docker/jvm/jsa_launch docker/native/native_command.sh
  • git diff --check

This change does not modify Kafka APIs, protocols, or configuration semantics, so no KIP is required.

Reviewers: Arthur S (github:arixmkii)

Generated-by: OpenAI Codex (GPT-5)

Signed-off-by: Yunseop Eom <62834176+lh0156@users.noreply.github.com>
@github-actions github-actions Bot added triage PRs from the community docker Official Docker image small Small PRs labels Aug 3, 2026
Comment thread docker/native/Dockerfile Outdated
# limitations under the License.

FROM ghcr.io/graalvm/graalvm-community:21 AS build-native-image
FROM ghcr.io/graalvm/graalvm-community:25 AS build-native-image

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

GraalVM community has moved to new release scheme delivering CPU only with feature releases. Current one has tag 25i2 which can be viewed in https://github.com/graalvm/container/pkgs/container/graalvm-community and is equivalent of https://github.com/graalvm/graalvm-ce-builds/releases/tag/graal-25.2.4

OpenJDK LTS support equivalent to GraalVM EE by Oracle will be only available from mandrel project https://github.com/graalvm/mandrel but they lag behind with release times and I'm not sure of they publish ready to use Docker images.

Current ghcr.io/graalvm/graalvm-community:25 is 6 months old already (missing 2 CPU releases). It is not a great option to have.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It seems Mandrel images are only published to Quay https://groups.google.com/g/quarkus-dev/c/Cs-9VKrASbI?pli=1 and are heavily leaning toward RHEL runtimes, so, it should be checked if they are suitable to be used as a replacement as is.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in e348eae.

  • Updated the native build image from ghcr.io/graalvm/graalvm-community:25 to 25i2, the current JDK 25.0.4 CPU-release tag available for both linux/amd64 and linux/arm64.
  • Updated the native-image documentation link from the JDK 21-specific page to GraalVM's version-neutral page.
  • The RED regression assertion reproduced the stale :25 tag; the GREEN assertion passes after the change, and git diff --check passes.

A local Docker build check could not resolve registry metadata because this environment lacks docker-credential-desktop; the public GHCR manifest was verified directly.

Use the current GraalVM 25i2 image for native builds so the base image tracks the latest JDK 25 CPU release. Keep the native-image documentation link version-neutral.

Generated-by: OpenAI Codex (GPT-5)

Signed-off-by: Yunseop Eom <62834176+lh0156@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Official Docker image small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants