Skip to content

hadolint/DL3024

Duplicate stage names are not allowed.

Superseded by buildkit/DuplicateStageName, which provides the same check.

Description

Defining multiple stages with the same name results in an error because the builder is unable to uniquely resolve the stage name reference.

Examples

Problematic code

FROM debian:latest AS builder
RUN apt-get update

FROM golang:latest AS builder

Correct code

FROM debian:latest AS deb-builder
RUN apt-get update

FROM golang:latest AS go-builder

Reference