support BuildKit local output delete mode#3883
Draft
crazy-max wants to merge 4 commits into
Draft
Conversation
825ba8f to
9ca5ebf
Compare
9ca5ebf to
79ac8d7
Compare
…mirror Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
79ac8d7 to
3b59d17
Compare
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
3b59d17 to
5d9eadf
Compare
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.
needs moby/buildkit#6561
This PR adds Buildx client-side support for the BuildKit local exporter
mode=deletebehavior introduced by moby/buildkit#6561. Buildx now passes the local exporter mode through for bothbuild --outputand Bake outputs, and it gates deletion of stale local output files behind the Buildx-local--allow=buildx.local.deleteentitlement where the destination is potentially dangerous.The build command now accepts
--output=type=local,dest=...,mode=deleteand keeps the exporter attribute intact when creating BuildKit export entries. Buildx parses--allow=buildx.local.deleteseparately from BuildKit entitlements, so the Buildx-local allow is used for client-side validation and is not forwarded to BuildKit as anAllowedEntitlement.The build command allows
mode=deletewithout an extra allow when the local output destination resolves to a subdirectory of the current working directory. It requires--allow=buildx.local.deletewhen the destination resolves to the current working directory, outside the current working directory, or through a symlink that escapes the current working directory. This keeps ordinaryoutordistusage ergonomic while still making destructive destinations explicit.Bake now recognizes the same
buildx.local.deleteentitlement for local outputs that usemode=delete. The Bake entitlement prompt and raw JSON error path both report the Buildx-local allow name, and Bake output definitions and--setoutput overrides are covered by the same entitlement flow.Testing on buildx repo with
mode=deleteforbinariestarget: