Skip to main content
Stage names in multi-stage builds should be lowercase.
PropertyValue
SeverityWarning
CategoryStyle
DefaultEnabled
Auto-fixYes (--fix)

Description

Stage name should be lowercase. To help distinguish Dockerfile instruction keywords from identifiers, this rule forces names of stages in a multi-stage Dockerfile to be all lowercase.

Examples

Bad:
FROM alpine AS BuilderBase
Good:
FROM alpine AS builder-base

Auto-fix

The fix renames the stage to lowercase and updates all references (FROM, COPY --from).
# Before
FROM alpine AS Builder
COPY --from=Builder /app .

# After (with --fix)
FROM alpine AS builder
COPY --from=builder /app .

Reference