401 Not Authorized when `e2b template build` pushes the container

Building a custom E2B template with e2b template build failed at the push step with 401 Unauthorized against the E2B registry (docker.e2b.dev), even after e2b auth logout + e2b auth login, restarting Docker, and manually adding registry credentials to [home directory] The Docker build itself completed fine — only pushing the image was rejected. Affected CLI 0.5.10 with Docker 27.x.

E2B fixed this in @e2b/cli@1.0.6 and later — run npm i -g @e2b/cli@latest. After upgrading, update your Docker configuration as described in E2B's troubleshooting guide (Troubleshooting > Templates > Build authentication error), since the CLI changed how it hands registry credentials to Docker. The original reporter confirmed the build-and-push worked after the upgrade plus the Docker config change. Source: https://github.com/e2b-dev/E2B/issues/450

Source: https://github.com/e2b-dev/E2B/issues/450