`failed to authorize: failed to fetch oauth token: ... 401` from BuildKit while `docker pull` works.
IntermediateTroubleshootingRegistry, pull and push errors
Answer
Likely causes → Builder uses different credentials (running as another user/sudo, remote builder), or the base image is private and no login in the build context.
Diagnose → sudo -E docker buildx build; echo $HOME; which config.json is read.
Fix → Log in as the same user running the build, set DOCKER_CONFIG, avoid sudo without -E.
Prevent → Standardise runner user/credentials.
More on Registry, pull and push errors
`Error response from daemon: pull access denied for X, repository does not exist or may require 'docker login'`Intermediate`manifest for myapp:1.2 not found: manifest unknown: manifest unknown`Beginner`no matching manifest for linux/arm64/v8 in the manifest list entries`Intermediate`x509: certificate signed by unknown authority` on `docker pull` from a private registry.Intermediate`http: server gave HTTP response to HTTPS client`Beginner`unauthorized: authentication required` on push to GitHub Container Registry.Intermediate