DL3036 - Clean zypper cache

Description

zypper package cache should be cleared after installations to keep images small and avoid stale metadata.

Goals

Specification

  1. Iterate over each RUN instruction in the Dockerfile and split the instruction into shell command segments.
  2. Determine if any segment executes zypper install or zypper in.
  3. Within the same RUN instruction, check for a segment running zypper clean or zypper cc.
  4. If a zypper install occurs without subsequent cleanup, emit DL3036 at the RUN line with the message `zypper clean` missing after zypper use.

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