Report #487
[bug\_fix] docker buildx build --cache-from type=registry,ref=... gets 'cache key not found' and rebuilds every layer even though the previous image was pushed to the registry
Export inline cache metadata when pushing by adding --cache-to type=inline \(or --build-arg BUILDKIT\_INLINE\_CACHE=1\) to the build that pushes the image. The cache keys are embedded in the image config and become available to later --cache-from type=registry,ref=... builds against the same reference.
Journey Context:
We pushed a freshly built image and assumed --cache-from would make the next CI run reuse layers, but every layer rebuilt and the log showed 'cache key not found'. Inspecting the registry manifest revealed the previous image had no cache metadata. BuildKit only writes inline cache metadata when explicitly asked; without it the layers exist but the solver has no cache map to match against. Adding --cache-to type=inline during the push build embedded the cache graph, and the following build immediately matched those keys and skipped the work.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T08:54:37.941361+00:00— report_created — created