-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix(docker): fix distroless build failure and upgrade to debian12 #25132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughBase image changed to Debian 12 distroless; build stage now creates Changes
Pre-merge checks✅ Passed checks (4 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (9)📓 Common learnings📚 Learning: 2025-11-24T18:37:11.466ZApplied to files:
📚 Learning: 2025-11-24T18:34:55.173ZApplied to files:
📚 Learning: 2025-11-24T18:37:30.259ZApplied to files:
📚 Learning: 2025-11-24T18:35:50.422ZApplied to files:
📚 Learning: 2025-11-24T18:37:30.259ZApplied to files:
📚 Learning: 2025-11-24T18:34:55.173ZApplied to files:
📚 Learning: 2025-11-20T19:51:32.288ZApplied to files:
📚 Learning: 2025-10-26T01:32:04.844ZApplied to files:
🪛 Checkov (3.2.334)dockerhub/distroless/Dockerfile[low] 63-63: Ensure the base image uses a non latest version tag (CKV_DOCKER_7) 🪛 Hadolint (2.14.0)dockerhub/distroless/Dockerfile[warning] 63-63: Always tag the version of an image explicitly (DL3006) 🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
## Problem Distroless Docker image build has been failing in CI/CD since v1.1.45 (4+ months ago). This prevented the distroless image from being published to Docker Hub. Error: `exec /bin/sh: no such file or directory` Root cause: Distroless base image does not contain shell, but Dockerfile used heredoc syntax which requires `/bin/sh` to execute. ## Solution 1. Create all symlinks in build stage (where shell is available) - ln -s /usr/local/bin/bun /usr/local/bin/bunx - ln -s /usr/local/bin/bun /usr/local/bun-node-fallback-bin/node 2. In distroless stage, only COPY symlinks (no RUN commands needed) - COPY --from=build /usr/local/bin/bunx - COPY --from=build /usr/local/bun-node-fallback-bin/ 3. Upgrade base image from debian11 to debian12 - Fixes security vulnerabilities (1 HIGH CVE → 0) - Uses gcr.io/distroless/base-debian12 ## Testing - Local build: ✅ Success (linux/amd64) - Azure-dev build: ✅ Success (linux/amd64) - Verified symlinks: ✅ All working (bun, bunx, node) - Image size: 228MB (comparable to debian variant at 221MB) ## Related Issues Closes oven-sh#20414 Closes oven-sh#16666 Related to oven-sh#22601, oven-sh#19788
1cd278f to
e669ca4
Compare
|
Hi maintainers! 👋 I'm a developer from SAP, and we're evaluating Bun for potential use in our production environments. Our security compliance requirements are very strict, and we specifically need the distroless variant for production deployments due to its minimal attack surface and reduced CVE exposure. This PR fixes the distroless image build that has been broken since v1.1.45 (4+ months ago). The fix has been:
Could you please approve the workflow runs so we can verify this fix passes CI/CD? This would help us move forward with our evaluation and potentially adopt Bun in SAP's production infrastructure. Thank you for your time and consideration! 🙏 |
|
@Jarred-Sumner @dylan-conway @markovejnovic Could you please help review and approve the workflow runs for this PR? This fixes the distroless Docker image that has been broken for 4+ months, which is critical for our security compliance requirements at SAP. Thank you! 🙏 |
|
fixed by #24055 |
Problem
Distroless Docker image build has been failing in CI/CD since v1.1.45 (4+ months ago).
This prevented the distroless image from being published to Docker Hub.
Error:
exec /bin/sh: no such file or directoryRoot cause: Distroless base image does not contain shell, but Dockerfile used heredoc
syntax which requires
/bin/shto execute.Solution
Create all symlinks in build stage (where shell is available)
ln -s /usr/local/bin/bun /usr/local/bin/bunxln -s /usr/local/bin/bun /usr/local/bun-node-fallback-bin/nodeIn distroless stage, only COPY symlinks (no RUN commands needed)
COPY --from=build /usr/local/bin/bunxCOPY --from=build /usr/local/bun-node-fallback-bin/Upgrade base image from debian11 to debian12
gcr.io/distroless/base-debian12Testing
Related Issues
Closes #20414
Closes #16666
Related PRs
Related to #22601, #19788
Testing performed: