docs: replace GHA local cache workaround with reset - #25977
Merged
Merged
Conversation
The local cache example used a Move cache step to work around the cache directory growing on every run, citing moby/buildkit#1896. That issue is closed: moby/buildkit#6612 added a reset attribute to the local cache exporter, and Buildx v0.35.0 is the first release to carry it. Export to the cache directory directly with reset=true instead. Measured over five runs exporting to the same directory: without reset the store grew from 5 to 21 blobs, with reset it stayed at 5, and importing from it on a fresh builder still hit the cache. The callout is now a note rather than a warning, since the growth has a supported fix. 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.
Note
Depends on #25976, which documents the
resetparameter this example nowuses. Please merge that one first.
The local cache example carried a
Move cachestep to work around the cachedirectory growing on every run, pointing at
moby/buildkit#1896. That issue isclosed — moby/buildkit#6612 added a
resetattribute to the local cacheexporter, and Buildx v0.35.0 is the first release to carry it.
This exports to the cache directory directly with
reset=trueand drops theextra step.
Verification
Five runs exporting to the same directory, each with a changed layer:
resetreset=trueThe cache still works after five reset cycles. Importing from that directory on
a fresh
docker-containerbuilder, with no local build cache to fall back on,hit both layers and produced no import warnings.
cache-fromandcache-topointing at the same directory is fine here: theimport runs during the solve and the reset runs after it.
Version requirement
setup-buildx-actioninstalls the latest Buildx whenversionis unset, so thedefault setup meets this. The note states the requirement for anyone pinning an
older version.
Callout
Changed from a warning to a note. The growth is still worth mentioning, but it
has a supported fix now rather than being an open problem.