docs: document reset parameter for local cache backend - #25976
Merged
Merged
Conversation
The local cache exporter accepts reset=true, which deletes blobs that no tag in the cache directory references. Blobs referenced by other tags are kept, and manifests that no tag references can no longer be imported by digest. Added in moby/buildkit#6612, which changes the client only. The gate is therefore the Buildx version rather than the BuildKit daemon version: Buildx v0.35.0 is the first release to vendor moby/buildkit v0.31.0. Fixes docker#25959 Signed-off-by: Sunmin Lee <134378502+sunm2n@users.noreply.github.com>
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Fixes #25959.
That issue asked for two things. The stale
moby/buildkit#1896reference wasalready removed in #25943; this adds the missing
resetdocumentation.Verification
Tested against
buildx v0.35.0-desktop.2:reset=trueremoved the blobs belonging to a manifest no tag pointed at(10 blobs to 7), and left the blobs of the other tag in place.
local cache import ... skipped: digest ... unavailable: content ...: not foundand the build continues.
reset, re-exporting the same tag twice grows the directory, matchingthe paragraph above the new text.
Version gate
The gate is the Buildx version, not the BuildKit daemon version.
moby/buildkit#6612 changes
client/solve.goonly, andresetCacheStorerunsclient-side after the solve. Confirmed both ways:
Buildx v0.35.0 is the first release to vendor
moby/buildkit v0.31.0.This matters because
docker buildx inspectreports the daemon BuildKitversion, so naming BuildKit here would send readers to the wrong number.
Not included
Concurrent exports. If two builds export to the same directory with
reset=true, one can delete a blob the other just registered, leavingindex.jsonpointing at a missing blob. I filed this upstream asmoby/buildkit#7102. I left it out of the docs because the same concurrent
export loses a tag entry even without
reset, so it isn't specific to thisparameter, and it reads more like a bug to fix than behavior to document.
Happy to add a note if you'd rather warn readers in the meantime.
GitHub Actions page.
content/manuals/build/ci/github-actions/cache.mdstill says old cache entries aren't deleted and points at
moby/buildkit#1896for the
Move cacheworkaround. That contradicts this page now. It's a separatepage and a separate fix, so I left it for a follow-up — let me know if you'd
prefer it here.