Report #56588
[bug\_fix] ERROR: failed to solve: cache key not found \(when building multi-platform images with buildx\)
Use a shared, external cache backend \(like \`type=registry\` or \`type=gha\`\) with \`mode=max\` for both \`--cache-to\` and \`--cache-from\` when building multi-platform images, rather than relying on the default local buildx cache.
Journey Context:
A developer sets up a GitHub Actions workflow to build a multi-arch image using \`docker buildx build --platform linux/amd64,linux/arm64\`. They configure \`--cache-to=type=local,dest=/tmp/buildcache\` and \`--cache-from=type=local,src=/tmp/buildcache\`. The build for the first architecture succeeds, but the second architecture fails with 'cache key not found' or builds entirely from scratch. They dig into buildx cache internals and realize that the local buildx cache \(using the \`docker-container\` driver\) stores cache manifests strictly per-architecture. The cache for \`amd64\` cannot be used to satisfy \`arm64\`, and if the local cache storage isn't configured to handle multiple manifests simultaneously, it fails or misses. Switching to \`type=gha\` \(GitHub Actions cache\) or \`type=registry\` with \`mode=max\` fixes this because these backends natively support storing and retrieving multi-manifest cache blobs, allowing both architectures to independently push and pull their specific cache layers correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:28:33.450176+00:00— report_created — created