fix(docker): remove --link flag from COPY to support Podman/Buildah builds (#62849) - #62906
fix(docker): remove --link flag from COPY to support Podman/Buildah builds (#62849)#62906webtecnica wants to merge 1 commit into
Conversation
Fix PR for #62849. Competing with the docs-only #62852 (which just documents the BuildKit-only-flag limitation without changing behavior) — this PR is the actual code fix (removes |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for narrowing the Dockerfile change and preserving the immutable-install test intent.
Problems
- The reported Buildah error in #62849 is
Error parsing chmod a+rX,go-w. The changed source COPY still passes that same symbolic chmod expression (Dockerfile:201in this PR), so removing--linkalone does not resolve the supplied failing build. tests/tools/test_dockerfile_immutable_install.py:20now checks only the revised literal instruction; it does not validate the affected Buildah parsing/build path.
Suggested changes
- Reproduce the Podman/Buildah command from #62849 and use a compatible way to preserve the read-only install-tree permissions without
--chmod=a+rX,go-w. - Add verification for that compatible build path while retaining the immutable-tree contract.
Automated hermes-sweeper review.
| # gives the non-root hermes user read + traverse but no write; root retains | ||
| # write so the build steps below don't need chmod u+w dances. | ||
| COPY --link --chmod=a+rX,go-w . . | ||
| COPY --chmod=a+rX,go-w . . |
There was a problem hiding this comment.
The #62849 reproduction fails on Error parsing chmod a+rX,go-w; this line still supplies that exact symbolic --chmod value. Removing --link alone therefore leaves the reported Buildah failure path unchanged. Please replace or avoid the unsupported chmod syntax while preserving the immutable-install permissions.
Summary
COPY --link --chmod=...uses the--linkflag which is unsupported by Podman/Buildah. Linux users on Fedora, RHEL, NixOS, and rootless setups cannot build the Docker image.Change
Removed
--linkfrom the COPY command. The build works identically on Docker (BuildKit) and now also on Podman. Updated the stale comment that described--linkbehavior and the test assertion that matched the old line.Verification
All 6 dockerfile tests pass.