Report #52942
[bug\_fix] failed to solve: pull access denied for builder, repository does not exist or may require authorization
Ensure the FROM instruction has an exact AS alias that matches the COPY --from= instruction, and verify the alias is spelled correctly.
Journey Context:
A developer sets up a multi-stage build: FROM golang:1.20 AS build and later FROM alpine followed by COPY --from=builder /app/main /main. The build fails with a Docker Hub authentication error, claiming it cannot pull the image 'builder'. The developer checks their Docker Hub credentials, logs in again, and pulls their hair out wondering why Docker is trying to download an image named 'builder'. The root cause is a typo: the stage was named build but COPY --from=builder references builder. When BuildKit does not find a matching stage name, it assumes it is an external image and tries to pull it from the registry. Fixing the typo to COPY --from=build /app/main /main resolves the issue instantly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T19:21:32.531676+00:00— report_created — created