Skip to content

fix(docker): remove --link flag from COPY to support Podman/Buildah builds (#62849) - #62906

Open
webtecnica wants to merge 1 commit into
NousResearch:mainfrom
webtecnica:fix/62849-dockerfile-podman
Open

fix(docker): remove --link flag from COPY to support Podman/Buildah builds (#62849)#62906
webtecnica wants to merge 1 commit into
NousResearch:mainfrom
webtecnica:fix/62849-dockerfile-podman

Conversation

@webtecnica

Copy link
Copy Markdown
Contributor

Summary

COPY --link --chmod=... uses the --link flag which is unsupported by Podman/Buildah. Linux users on Fedora, RHEL, NixOS, and rootless setups cannot build the Docker image.

Change

Removed --link from the COPY command. The build works identically on Docker (BuildKit) and now also on Podman. Updated the stale comment that described --link behavior and the test assertion that matched the old line.

Verification

All 6 dockerfile tests pass.

@alt-glitch alt-glitch added type/bug Something isn't working area/docker Docker image, Compose, packaging P2 Medium — degraded but workaround exists labels Jul 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

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 --link). Note: #62849 also reports --chmod=a+rX,go-w failing on Buildah, which this PR does not touch (only --link is removed), so verify whether the --chmod half still needs addressing. Cross-linking so a maintainer can pick between the code fix (#62906) and the docs note (#62852).

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:201 in this PR), so removing --link alone does not resolve the supplied failing build.
  • tests/tools/test_dockerfile_immutable_install.py:20 now 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.

Comment thread Dockerfile
# 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 . .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docker Docker image, Compose, packaging P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants