fix(docker): replace curl|bash Bun install with pinned multi-stage COPY#74359
fix(docker): replace curl|bash Bun install with pinned multi-stage COPY#74359sallyom merged 4 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR eliminates the Confidence Score: 4/5Safe to merge; the supply-chain improvement is sound and the only finding is a missing SHA256 digest already acknowledged as a follow-up. Single P2 finding (missing digest pin on the new bun image) that the PR author has already called out. No logic errors, no security regressions relative to the prior state. Dockerfile line 19 — consider adding a SHA256 digest to OPENCLAW_BUN_IMAGE before the follow-up PR. Prompt To Fix All With AIThis is a comment left during a code review.
Path: Dockerfile
Line: 19
Comment:
**Bun image not pinned to a SHA256 digest**
`oven/bun:1.3.9` is referenced by mutable tag only. The Dockerfile's own stated policy (lines 21–26) is that all base images are pinned to SHA256 digests for reproducible builds and supply-chain integrity. Without a digest, Docker will silently pull a different layer if the tag is ever retagged on Docker Hub, which partially undermines the goal of this PR. The PR description calls this out as a follow-up, but adding the digest now would be consistent with how the Node images are handled.
Run `docker buildx imagetools inspect oven/bun:1.3.9` to obtain the correct multi-arch manifest digest.
```suggestion
ARG OPENCLAW_BUN_IMAGE="oven/bun:1.3.9@sha256:<digest>"
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(docker): replace curl|bash Bun insta..." | Re-trigger Greptile |
|
Codex review: found issues before merge. Summary Reproducibility: yes. Static inspection of current main reproduces the reported condition: the root Dockerfile still executes Next step before merge Security Review findings
Review detailsBest possible solution: Land this Docker hardening after maintainer/security approval and Docker build proof, then handle docs-example hardening separately if maintainers want the policy to cover copy-paste examples. Do we have a high-confidence way to reproduce the issue? Yes. Static inspection of current main reproduces the reported condition: the root Dockerfile still executes Is this the best way to solve the issue? Yes, with a non-blocking test-helper caveat. Copying Bun from a digest-pinned official image aligned with CI is the narrow maintainable fix for the live Dockerfile risk; the digest helper should model Docker ARG scope more precisely for future coverage. Full review comments:
Overall correctness: patch is correct Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against dda2db97d43b. |
a194552 to
9d7a9dc
Compare
|
Codex review: needs maintainer review before merge. What this changes: The PR updates the root Dockerfile to copy Bun 1.3.9 from a digest-pinned Maintainer follow-up before merge: This is an active external-contributor PR touching Docker supply-chain hardening; the remaining action is maintainer/security review plus CI and Docker build validation, not an automated replacement branch. Review detailsBest possible solution: Land a reviewed Docker hardening change that removes build-time execution of the remote Bun installer, keeps the Bun source image digest-pinned and aligned with the CI Bun version, validates all ARG-backed Docker stages, and closes #74356 through the merge after CI and Docker build proof pass. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e46dccb35374. |
e352890 to
6cb9a66
Compare
5c25750 to
e2532aa
Compare
12efc4e to
8f748b8
Compare
The previous approach fetched https://bun.sh/install and executed it as root with no version pin, checksum, or signature verification — despite both Node base images being pinned to SHA256 digests. Replace with a multi-stage COPY from the official oven/bun image, using the same version (1.3.9) already pinned in .github/actions/setup-node-env/action.yml. The new OPENCLAW_BUN_IMAGE ARG follows the same pattern as OPENCLAW_NODE_BOOKWORM_IMAGE and can be updated via Dependabot. Closes openclaw#74356
The existing check only validated the first FROM line. The new bun-binary
stage (FROM ${OPENCLAW_BUN_IMAGE}) would have been invisible to it.
Add resolveAllArgBackedFromReferences that walks every FROM line and
resolves ARG-backed image references, so all pinned base stages are
checked — not just the first one.
|
Thanks for this PR! I've updated CI and Dockerfile to latest Bun v1.3.13. |
…PY (openclaw#74359) Merged via squash. Prepared head SHA: 3b4a889 Co-authored-by: fede-kamel <209537060+fede-kamel@users.noreply.github.com> Co-authored-by: sallyom <11166065+sallyom@users.noreply.github.com> Reviewed-by: @sallyom
…PY (openclaw#74359) Merged via squash. Prepared head SHA: 3b4a889 Co-authored-by: fede-kamel <209537060+fede-kamel@users.noreply.github.com> Co-authored-by: sallyom <11166065+sallyom@users.noreply.github.com> Reviewed-by: @sallyom
Closes #74356
What changed
Dockerfile:43–55previously bootstrapped Bun by fetchinghttps://bun.sh/installand piping it directly tobashwith no version pin, checksum, or signature verification:Replaced with a pinned multi-stage
COPYfrom the officialoven/bunimage:Why
All other base images are pinned to SHA256 digests. The
curl | bashapproach bypassed this: a DNS hijack or CDN compromise ofbun.shduring any Docker build would execute attacker code as root and ship the result in the final image.Version choice
1.3.9matches the version already pinned in.github/actions/setup-node-env/action.yml:50viaoven-sh/setup-bun@v2.2.0. The newOPENCLAW_BUN_IMAGEARG follows the same override pattern as the Node image args.Follow-up (not in this PR)
Pin
oven/bun:1.3.9to a SHA256 digest and add it to the Dependabot config alongside the Node image digests.