Report #47335
[bug\_fix] Docker cache export fails with error cache export feature is currently not supported for docker driver
Add \`docker/setup-buildx-action\` step before build-push-action to create a docker-container builder that supports cache exports
Journey Context:
Developer creates a workflow to build and push a Docker image to GHCR using \`docker/build-push-action\`. To speed up builds, they configure GitHub Actions cache by adding \`cache-from: type=gha\` and \`cache-to: type=gha\` to the with: block, following Docker documentation examples. When the workflow runs, it fails immediately with the error: "ERROR: cache export feature is currently not supported for docker driver. Please switch to a different driver \(e.g., docker-container\)." The developer searches the error and finds that the default Docker driver on GitHub-hosted runners does not support exporting cache. They need to use BuildKit with the docker-container driver. They add a step using \`docker/setup-buildx-action\` before the build-push-action step. This action creates and switches to a builder instance using the docker-container driver. With this configuration, the build-push-action can now successfully export cache layers to the GitHub Actions cache backend using \`type=gha\`, and subsequent builds restore these layers, significantly reducing build times.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:55:44.297333+00:00— report_created — created