You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2026/03/21 21:28:31 UTC
[PR] [SPARK-56131] Use `jlink` custom JRE runtime to minimize Docker image size [spark-kubernetes-operator]
dongjoon-hyun opened a new pull request, #571:
URL: https://github.com/apache/spark-kubernetes-operator/pull/571
### What changes were proposed in this pull request?
This PR uses `jlink` to create a custom minimal JRE instead of using the pre-built `zulu-openjdk-alpine:26-jre` image. The Dockerfile now has a three-stage build:
1. **builder**: Builds the application JAR with Gradle
2. **jlink**: Uses `jdeps` to analyze module dependencies and `jlink` to create a stripped-down custom JRE
3. **final**: Uses `alpine:3.23` as the base image with the custom JRE copied in
The `jlink` stage includes the following optimizations:
- `--strip-debug`: Removes debug information
- `--compress zip-6`: Compresses modules
- `--no-header-files` / `--no-man-pages`: Removes unnecessary files
Additional modules (`jdk.security.auth`, `jdk.httpserver`, `jdk.unsupported`, `jdk.crypto.ec`, `java.management`) are explicitly included to ensure runtime compatibility.
### Why are the changes needed?
A custom JRE built with `jlink` contains only the modules required by the application, resulting in a significantly smaller Docker image compared to using the full JRE base image. This reduces container pull times, storage costs, and attack surface.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Manually tested by running `gradle buildDockerImage`.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.6)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56131] Use `jlink` custom JRE runtime to minimize Docker image size [spark-kubernetes-operator]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #571: [SPARK-56131] Use `jlink` custom JRE runtime to minimize Docker image size
URL: https://github.com/apache/spark-kubernetes-operator/pull/571
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56131] Use `jlink` custom JRE runtime to minimize Docker image size [spark-kubernetes-operator]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #571:
URL: https://github.com/apache/spark-kubernetes-operator/pull/571#issuecomment-4104690639
Merged to main
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-56131] Use `jlink` custom JRE runtime to minimize Docker image size [spark-kubernetes-operator]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #571:
URL: https://github.com/apache/spark-kubernetes-operator/pull/571#issuecomment-4104688523
Thank you, @viirya !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org