[SPARK-56128][K8S] Use Java 21-jre instead of 21 image in K8s Dockerfile#54940
Closed
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
Closed
[SPARK-56128][K8S] Use Java 21-jre instead of 21 image in K8s Dockerfile#54940dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
21-jre instead of 21 image in K8s Dockerfile#54940dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
Conversation
Member
Author
|
cc @pan3793 |
21-jre instead of 21 image in K8s Dockerfile21-jre instead of 21 image in K8s Dockerfile
Member
Author
|
Could you review this PR, too, @peter-toth ? |
peter-toth
approved these changes
Mar 21, 2026
Member
Author
|
Thank you, @peter-toth ! 😄 |
Member
Author
|
Merged to master for Apache Spark 4.2.0. |
Member
|
late lgtm |
Member
Author
|
Thank you, @pan3793 ! |
terana
pushed a commit
to terana/spark
that referenced
this pull request
Mar 23, 2026
…kerfile ### What changes were proposed in this pull request? This PR changes the default Java base image tag from `21` (full JDK) to `21-jre` (JRE only) in the Spark Kubernetes Dockerfile for Apache Spark 4.2.0. ### Why are the changes needed? Since Apache Spark 3.5, SPARK-44153 starts to use `jmap` for UI. - apache#41709 Since Apache Spark 4.0, we used `21` by default. - apache#45761 Since Apache Spark 4.2, we can use `21-jre` back by default because we removed `jmap` dependency. - apache#54919 The JRE image is significantly smaller than the full JDK image since it excludes development tools (compiler, debugger, etc.) that are not needed at runtime. This reduces the Spark container image size for Kubernetes deployments. ``` $ docker images IMAGE ID DISK USAGE CONTENT SIZE EXTRA azul/zulu-openjdk:21 4cfeb0cae1b1 651MB 203MB azul/zulu-openjdk:21-jre 27894d1c0e9d 461MB 114MB ``` ### Does this PR introduce _any_ user-facing change? No behavior change. In addition, users who need the full JDK can still override via `--build-arg java_image_tag=21`. ### How was this patch tested? Pass the CIs and manual review of the Dockerfile change. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-4-6) Closes apache#54940 from dongjoon-hyun/SPARK-56128. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR changes the default Java base image tag from
21(full JDK) to21-jre(JRE only) in the Spark Kubernetes Dockerfile for Apache Spark 4.2.0.Why are the changes needed?
Since Apache Spark 3.5, SPARK-44153 starts to use
jmapfor UI.Heap Histogramcolumn inExecutorstab #41709Since Apache Spark 4.0, we used
21by default.21instead of21-jreimage in K8s Dockerfile #45761Since Apache Spark 4.2, we can use
21-jreback by default because we removedjmapdependency.The JRE image is significantly smaller than the full JDK image since it excludes development tools (compiler, debugger, etc.) that are not needed at runtime. This reduces the Spark container image size for Kubernetes deployments.
Does this PR introduce any user-facing change?
No behavior change. In addition, users who need the full JDK can still override via
--build-arg java_image_tag=21.How was this patch tested?
Pass the CIs and manual review of the Dockerfile change.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-6)