Skip to content

[SPARK-56128][K8S] Use Java 21-jre instead of 21 image in K8s Dockerfile - #54940

Closed
dongjoon-hyun wants to merge 1 commit into
apache:masterfrom
dongjoon-hyun:SPARK-56128
Closed

[SPARK-56128][K8S] Use Java 21-jre instead of 21 image in K8s Dockerfile#54940
dongjoon-hyun wants to merge 1 commit into
apache:masterfrom
dongjoon-hyun:SPARK-56128

Conversation

@dongjoon-hyun

Copy link
Copy Markdown
Member

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.

Since Apache Spark 4.0, we used 21 by default.

Since Apache Spark 4.2, we can use 21-jre back by default because we removed jmap dependency.

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)

@dongjoon-hyun

Copy link
Copy Markdown
MemberAuthor

cc @pan3793

@dongjoon-hyundongjoon-hyun changed the title [SPARK-56128] Use Java 21-jre instead of 21 image in K8s Dockerfile[SPARK-56128][K8S] Use Java 21-jre instead of 21 image in K8s DockerfileMar 21, 2026
@dongjoon-hyun

Copy link
Copy Markdown
MemberAuthor

Could you review this PR, too, @peter-toth ?

@dongjoon-hyun

Copy link
Copy Markdown
MemberAuthor

Thank you, @peter-toth ! 😄

@dongjoon-hyun
dongjoon-hyun deleted the SPARK-56128 branch March 21, 2026 20:52
@dongjoon-hyun

Copy link
Copy Markdown
MemberAuthor

Merged to master for Apache Spark 4.2.0.

@pan3793

Copy link
Copy Markdown
Member

late lgtm

@dongjoon-hyun

Copy link
Copy Markdown
MemberAuthor

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)
Closesapache#54940 from dongjoon-hyun/SPARK-56128.
Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for freeto 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.

3 participants

@dongjoon-hyun@pan3793@peter-toth