Report #56557
[bug\_fix] Cache export feature is currently not supported for docker driver or cache not being reused between builds despite cache-to and cache-from being specified
Configure docker/setup-buildx-action with \`driver: docker-container\` \(not the default \`docker\` driver\), and ensure cache-to and cache-from use \`type=gha\` with \`mode=max\` for multi-stage builds to ensure all layers are exported, not just the final image layers.
Journey Context:
You set up a GitHub Actions workflow to build a Docker image using docker/build-push-action. You add cache-from and cache-to parameters hoping to speed up builds by caching layers. The first build works and appears to export cache, but subsequent builds show "importing cache" then proceed to rebuild all layers from scratch anyway. You check the logs and see "cache export feature is currently not supported for docker driver" or similar warnings that you missed initially. You realize that the default docker driver \(the classic Docker engine\) doesn't support exporting cache metadata to the GitHub Actions cache backend. You need to switch to the docker-container driver using docker/setup-buildx-action, which runs BuildKit in a separate container and supports the gha cache exporter. Additionally, you need to set mode=max in cache-to to export all layers from multi-stage builds, not just the final stage.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:25:23.269598+00:00— report_created — created