buildah icon indicating copy to clipboard operation
buildah copied to clipboard

feat: ADD/COPY --link support for buildah

Open 2004joshua opened this issue 6 months ago • 5 comments

What type of PR is this?

/kind feature

What this PR does / why we need it:

This patch implements the --link functionality for COPY and ADD instructions, enabling the creation of cachable layers that can be reused independently across builds.

When specified, content is staged separately and archived into an independent layer with computed digest, allowing cache reuse even when underlying base layers change.

Follows Buildkit --link specifications while maintaining compatibility with existing COPY/ADD behavior.

How to verify it

bats tests/bud.bats

Which issue(s) this PR fixes:

Fixes #4325

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Yes, COPY --link and ADD --link instructions now fully support layered build caching.

2004joshua avatar Jun 23 '25 15:06 2004joshua

Ephemeral COPR build failed. @containers/packit-build please check.

Ephemeral COPR build failed. @containers/packit-build please check.

Can you rebase onto the main branch and squash your commits?

nalind avatar Jun 23 '25 20:06 nalind

The "user-facing change" section is the kind of text which would be reproduced verbatim in the release notes for a release (for example, if we started scripting, digging the descriptions of the merged PRs, and snipping out just the bit with the "```release-note" header), so it should describe the change instead of alluding to it.

nalind avatar Jun 23 '25 21:06 nalind

I found a couple of nits that should be tweaked. @nalind @2004joshua do you think this is close to getting merged this week? We had a delivery date of next Monday.

TomSweeneyRedHat avatar Jul 09 '25 18:07 TomSweeneyRedHat

LGTM

nalind avatar Jul 09 '25 21:07 nalind

@containers/buildah-maintainers PTAL

nalind avatar Jul 10 '25 15:07 nalind

A couple of tests look to be hiccuping, restarting.

TomSweeneyRedHat avatar Jul 10 '25 20:07 TomSweeneyRedHat

/approve /lgtm

rhatdan avatar Jul 11 '25 15:07 rhatdan

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 2004joshua, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Jul 11 '25 15:07 openshift-ci[bot]