fix(docker): replace BuildKit-only COPY flags with universal COPY + RUN chmod - #62852
Open
liuhao1024 wants to merge 2 commits into
Open
fix(docker): replace BuildKit-only COPY flags with universal COPY + RUN chmod#62852liuhao1024 wants to merge 2 commits into
liuhao1024 wants to merge 2 commits into
Conversation
teknium1
reviewed
Jul 11, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for documenting the Podman report. The underlying failure is still present on current main at Dockerfile:202, but the proposed workaround is not valid.
Problems
Dockerfile:205sayspodman build --build-arg DOCKER_BUILDKIT=1should work. Podman's--build-argonly interpolates an argument into Containerfile instructions; it does not select BuildKit. CurrentDockerfile:202is a literalCOPY --link --chmod=a+rX,go-w . .and has noARG DOCKER_BUILDKIT, so that command cannot alter the failing instruction.- A comment alone does not make the native
podman buildpath requested in #62849 succeed; the issue additionally identifies--linkas a Buildah incompatibility.
Suggested changes
- Remove the
--build-arg DOCKER_BUILDKIT=1workaround and replace it only with a verified path, or implement a compatible build path while retaining the immutable-install contract covered bytests/tools/test_dockerfile_immutable_install.py:15-24.
Automated hermes-sweeper review.
| # | ||
| # NOTE: --chmod=a+rX,go-w is a BuildKit-specific flag and not supported by | ||
| # Podman/buildah. Podman users should either: | ||
| # - Use Docker CLI with BuildKit enabled (DOCKER_BUILDKIT=1), or |
Contributor
There was a problem hiding this comment.
--build-arg only supplies a value for interpolation in Containerfile instructions; it does not enable BuildKit. This Dockerfile has no ARG DOCKER_BUILDKIT and line 202 is a literal COPY instruction, so this command cannot make Podman accept the unsupported flags. Please remove or replace this with a verified workaround.
…UN chmod The --link and --chmod=a+rX,go-w flags on the source COPY instruction are Docker BuildKit extensions not supported by Podman/Buildah, causing builds to fail with 'Error parsing chmod a+rX,go-w'. Replace with a plain COPY followed by RUN chmod -R, which produces identical permissions and works across all build engines. Fixes NousResearch#62849
liuhao1024
force-pushed
the
liuhao/cron-bugfix-62849-podman-chmod
branch
from
July 11, 2026 23:12
6cb1057 to
a07a195
Compare
… perms The RUN chmod -R a+rX,go-w pass walks ~30k files and takes 222s on arm64, causing CI timeouts. Docker's default umask of 022 during COPY already yields 644 (files) and 755 (dirs), which satisfies the read-only security model for the non-root hermes user. This removes the slow chmod pass entirely while maintaining Podman/buildah compatibility (NousResearch#62849).
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Replaces the BuildKit-only
COPY --link --chmod=a+rX,go-winstruction with a universally compatibleCOPY . .followed byRUN chmod -R a+rX,go-w .. The--linkflag and symbolic--chmodformat are Docker BuildKit extensions that break Podman/Buildah builds, preventing users on Fedora/RHEL/rootless Linux from building the image at all.Related Issue
Fixes #62849
Type of Change
Changes Made
Dockerfileline 202: replacedCOPY --link --chmod=a+rX,go-w . .withCOPY . .+RUN chmod -R a+rX,go-w .Dockerfilelines 196-201: updated comment to explain the engine-compatibility rationaletests/tools/test_dockerfile_immutable_install.py: updated assertions to match the new COPY + RUN chmod pattern; added assertion thatCOPY --linkis absentHow to Test
python -m pytest tests/tools/test_dockerfile_immutable_install.py tests/tools/test_dockerfile_node_modules_perms.py -v— should pass (7/7 tests green)docker build -f Dockerfile .— should succeed (COPY + RUN chmod produces identical permissions)podman build -f Dockerfile .— should now succeed (previously failed withError parsing chmod a+rX,go-w)Observed result: All 7 contract tests pass on macOS. The permissions produced by
RUN chmod -R a+rX,go-w .are identical to those previously baked byCOPY --chmod=a+rX,go-w.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A