FROM stage aliases must be unique because duplicate aliases make references such as COPY --from=<alias> ambiguous, which can cause incorrect artifacts or unintended files (including secrets) to be pulled into later stages and compromise image integrity.
Check every Dockerfile FROM command and ensure the token following AS (the stage alias) is distinct across all FROM commands. This rule flags cases where two or more FROM commands define the same alias. Resources without an AS alias are not affected. Ensure each multi-stage build uses a unique alias for each stage so stage references resolve unambiguously.
Secure example:
FROMgolang:1.20ASbuilderWORKDIR/srcRUN go build -o /app/myappFROMalpine:3.18ASruntimeCOPY --from=builder /app/myapp /usr/local/bin/myapp