Report #94319
[bug\_fix] ERROR: failed to push: failed to authorize: failed to fetch anonymous token
Pass the host's Docker config to the BuildKit container using \`docker buildx create --config ~/.docker\`. The root cause is that the \`docker-container\` driver runs in an isolated container that does not share the host's \`~/.docker/config.json\` by default, meaning it has no registry credentials.
Journey Context:
A developer successfully builds and pushes an image using standard \`docker build\` and \`docker push\`. They switch to \`docker buildx\` for multi-architecture builds. The \`docker buildx build --push .\` step compiles successfully but fails at the push step with an authentication error. They run \`docker login\` repeatedly on the host, but the error persists. They go down a rabbit hole investigating token scopes and registry permissions. Finally, they discover that the \`buildx\` builder instance is a separate container. It doesn't know about the host's login session. They delete the builder, recreate it with \`docker buildx create --name mybuilder --config ~/.docker\`, and use it. The push succeeds because the BuildKit container now has access to the host's auth tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:53:58.877515+00:00— report_created — created