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/20 17:35:02 UTC

[PR] [SPARK-56110] Use `Distroless` images for `Examples` [spark-connect-swift]

dongjoon-hyun opened a new pull request, #332:
URL: https://github.com/apache/spark-connect-swift/pull/332

   ### What changes were proposed in this pull request?
   
   This PR uses Google `Distress` images as the runtime base image for all Swift example Dockerfiles (`app`, `pi`, `spark-sql`, `stream`, `web`).
   
   Key changes:
   - Use `gcr.io/distroless/cc-debian13:nonroot` instead of `ubuntu:24.04` for runtime stage
   - Remove manual user/group creation (`groupadd`/`useradd`) — distroless `nonroot` tag provides a built-in nonroot user (UID `65532`)
   - Remove unnecessary `ENV`, `WORKDIR`, and shell invocations
   - Use direct `ENTRYPOINT` with exec form instead of `/bin/sh -c` wrapper
   - Update README image sizes accordingly.
   
   ### Why are the changes needed?
   
   1. **Smaller image size**: Distroless images contain only the application and its runtime dependencies, reducing image size by ~23% (e.g., 373MB → 287MB).
   2. **Improved security**: Distroless images have a minimal attack surface — no shell, no package manager, no unnecessary OS utilities — reducing the risk of CVEs.
   3. **Simplified Dockerfile**: Removing manual user management and shell wrappers makes the Dockerfiles cleaner and easier to maintain.
   4. **Best practice**: Using `cc-debian13` variant (instead of `base`) provides `libstdc++.so.6` required by Swift binaries, while the `nonroot` tag ensures the container runs as a non-root user by default.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. The example applications behave identically. The only observable difference is smaller Docker image sizes.
   
   ### How was this patch tested?
   
   Docker images were built and verified to run correctly with the new distroless base images. Image sizes were measured and documented in the updated READMEs.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (claude-code/1.0)


-- 
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-56110] Use `Distroless` images for `Examples` [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #332:
URL: https://github.com/apache/spark-connect-swift/pull/332#issuecomment-4099852266

   cc @viirya and @peter-toth 


-- 
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-56110] Use `Distroless` images for `Examples` [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #332:
URL: https://github.com/apache/spark-connect-swift/pull/332#issuecomment-4099943072

   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-56110] Use `Distroless` images for `Examples` [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #332:
URL: https://github.com/apache/spark-connect-swift/pull/332#issuecomment-4099937537

   Thank you always, @peter-toth and @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


Re: [PR] [SPARK-56110] Use `Distroless` images for `Examples` [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #332: [SPARK-56110] Use `Distroless` images for `Examples`
URL: https://github.com/apache/spark-connect-swift/pull/332


-- 
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