DL4001 - Either use Wget or Curl but not both

Description

Avoid installing or invoking both curl and wget in the same stage. Choose a single tool to reduce image size and complexity.

Goals

Specification

  1. Iterate through Dockerfile instructions, resetting state on each FROM.
  2. For each RUN instruction:
  3. Extract individual shell commands.
  4. Detect whether any command starts with curl or wget.
  5. If a single RUN uses both tools or if one tool is used after the other has already appeared in the current stage, emit DL4001.
  6. Report the line of the offending RUN with the message Either use Wget or Curl but not both.

(c) 2025 Asymmetric Effort, LLC. scaldwell@asymmetric-effort.com Asymmetric Effort logo