Skip to content

docs: document reset parameter for local cache backend - #25976

Merged
dvdksn merged 1 commit into
docker:mainfrom
sunm2n:docs-local-cache-reset-param
Aug 31, 2026
Merged

dvdksn merged 1 commit into
docker:mainfrom
sunm2n:docs-local-cache-reset-param

Conversation

@sunm2n

@sunm2n sunm2n commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #25959.

That issue asked for two things. The stale moby/buildkit#1896 reference was
already removed in #25943; this adds the missing reset documentation.

Verification

Tested against buildx v0.35.0-desktop.2:

  • reset=true removed the blobs belonging to a manifest no tag pointed at
    (10 blobs to 7), and left the blobs of the other tag in place.
  • Importing the removed manifest by digest afterwards reports
    local cache import ... skipped: digest ... unavailable: content ...: not found
    and the build continues.
  • Without reset, re-exporting the same tag twice grows the directory, matching
    the paragraph above the new text.

Version gate

The gate is the Buildx version, not the BuildKit daemon version.
moby/buildkit#6612 changes client/solve.go only, and resetCacheStore runs
client-side after the solve. Confirmed both ways:

Combination Result
buildx v0.35.0 + BuildKit daemon v0.30.0 works
buildx v0.34.1 + BuildKit daemon v0.32.2 silently ignored, no warning

Buildx v0.35.0 is the first release to vendor moby/buildkit v0.31.0.
This matters because docker buildx inspect reports the daemon BuildKit
version, 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, leaving
index.json pointing at a missing blob. I filed this upstream as
moby/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 this
parameter, 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.md
still says old cache entries aren't deleted and points at moby/buildkit#1896
for the Move cache workaround. That contradicts this page now. It's a separate
page and a separate fix, so I left it for a follow-up — let me know if you'd
prefer it here.

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>
@sunm2n
sunm2n requested a review from dvdksn as a code owner August 31, 2026 03:55
@netlify

netlify Bot commented Aug 31, 2026

Copy link
Copy Markdown

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 4ce9ed5
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a94fb20a1ef36000806e5be
😎 Deploy Preview https://deploy-preview-25976--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the area/build Relates to Dockerfiles or docker build command label Aug 31, 2026

@dvdksn dvdksn 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.

Thank you!

@dvdksn
dvdksn merged commit 7561045 into docker:main Aug 31, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Relates to Dockerfiles or docker build command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

local cache backend should document the "reset" argument for the "cache-to" option

2 participants