duplicate-stage-name
What it does
Section titled “What it does”Reports a stage name that an earlier stage already uses, as in FROM a AS app followed by FROM b AS app. Names are compared without regard to case, as Docker does.
Why it matters
Section titled “Why it matters”FROM name and COPY --from=name refer to a stage by its name. With two stages of one name the builder cannot tell which one is meant, so Docker rejects the file.
Example
Section titled “Example”...FROM alpine:3 AS buildFROM buildFROM scratchFROM alpine:3 AS buildFROM $BASEFROM alpine:3 AS BuildFROM BUILD...FROM localhost:5000/img:1...Configuration
Section titled “Configuration”dockerfile: lint: rules: duplicate-stage-name: error # off, warn, error (default)Enabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line duplicate-stage-name in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| hadolint | DL3024 |
full |