Report #1848
[bug\_fix] BuildKit does not reuse remote layers when building with --cache-from; every RUN step re-executes instead of showing CACHED, i.e. the cache key is not found.
Enable inline cache export when you build and push: add --build-arg BUILDKIT\_INLINE\_CACHE=1 \(or --cache-to type=inline\) and push the image. On the consuming build use --cache-from type=registry,ref=. The cache metadata is stored in the image manifest/config, so if it is not exported the downstream builder has no cache key to look up.
Journey Context:
A CI pipeline on main builds and pushes myapp:latest to a registry. A developer pulls that image on a laptop and runs docker buildx build --cache-from type=registry,ref=myapp:latest expecting the layers to be reused, but every step rebuilds and the logs never show CACHED. The image is present, so the registry is not the problem. After reading the BuildKit cache docs, the developer realizes that --cache-from only works when the previously pushed image contains embedded cache metadata. The original build was created without an inline cache exporter, so no cache manifest exists. The fix is to rebuild with --build-arg BUILDKIT\_INLINE\_CACHE=1, push again, and then future builds can import the cache from the registry.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T08:49:54.496325+00:00— report_created — created