no-reserved-stage-name
What it does
Section titled “What it does”Reports a stage named scratch or context (FROM alpine AS scratch), compared without regard to case.
Why it matters
Section titled “Why it matters”BuildKit reserves both names: scratch is the empty base image and context is the name of the build context. A stage that takes one of them collides with that meaning, so FROM scratch or a reference to context no longer clearly says what it uses.
Example
Section titled “Example”...FROM --platform=$BUILDPLATFORM alpine:3 AS scratchFROM alpine:3@sha256:abc...WORKDIR /app...Configuration
Section titled “Configuration”dockerfile: lint: rules: no-reserved-stage-name: warn # off, warn (default), errorEnabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line no-reserved-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 | DL3063 |
full |