Interview Prep/Docker/Registry, pull and push errors

`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.

All Docker questions Roadmap: Docker & containers

More on Registry, pull and push errors