Skip to main content
Warns about build stages that don’t contribute to the final image.

Description

Detects stages that are defined but never used. A stage is considered “unreachable” if it:
  • Is not the final stage in the Dockerfile
  • Is not referenced by COPY --from=<stage>
  • Is not the target of a --target build argument
Unreachable stages add complexity and confusion without providing value. They may be:
  • Leftover from refactoring
  • Copy-paste artifacts
  • Forgotten experimental code

Examples

Bad

Good

Also Good (targeted builds)

Configuration