Report #8787
[bug\_fix] ERROR: failed to solve: failed to solve with frontend dockerfile.v0: failed to create build target: stage not found
Ensure the --from= exactly matches the AS alias defined in a FROM instruction earlier in the Dockerfile.
Journey Context:
A developer is writing a multi-stage build. They define their build stage as FROM golang:1.20 AS builder and later try to copy the artifact using COPY --from=build /app/main . The build fails with 'stage build not found'. They stare at the Dockerfile and see the FROM line clearly. The issue is a simple typo: builder vs build. BuildKit strictly validates stage names and throws this error when it cannot resolve the reference. Correcting the --from=build to --from=builder \(or vice versa\) fixes the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:22:44.228094+00:00— report_created — created