Skip to main content
Detects circular dependencies between build stages.

Description

Detects cycles in the stage dependency graph. A cycle occurs when stages form mutual dependencies through COPY --from=<stage>, RUN --mount from=<stage>, or FROM <stage> references. Circular dependencies always cause build failures because no stage in the cycle can finish building before the others — each waits for output from another. Common causes:
  • A refactoring accidentally swaps stage references
  • An AI-generated patch links stages in both directions
  • A copy-paste introduces a forward COPY --from that mirrors an existing backward reference

Examples

Bad

Good

Configuration