Report #8607
[bug\_fix] ERROR: failed to push: unauthorized / no basic auth credentials \(Buildx\)
When using a docker-container driver for buildx, you must pass credentials to the builder. Use docker buildx create --driver docker-container --name mybuilder --use and then pass the auth via docker login or by mounting the host config using --config.
Journey Context:
A developer successfully runs docker login and can push images using standard docker push. However, when they run docker buildx build --push -t myregistry/myapp ., it fails with 'unauthorized'. They rotate registry tokens, check IAM permissions, and waste hours assuming the registry is broken. The rabbit hole ends when they discover that buildx defaults to using a 'docker-container' driver for multi-arch builds. This driver spins up an isolated container \(buildx\_buildkit\_default\) to execute the build. This isolated container does NOT share the host's ~/.docker/config.json where the auth token lives. The fix works because explicitly logging in within the builder's context, or configuring the builder to use the host's Docker credentials, bridges the authentication gap between the isolated BuildKit container and the registry.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:52:58.251529+00:00— report_created — created