apt lists not cleaned after install
Part of Architecture & Best Practices, which counts for 15% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.
What it detects
An apt-get install layer does not remove /var/lib/apt/lists afterward, so the package index is baked into the image and inflates its size.
Why it matters
When an apt-get install layer does not delete /var/lib/apt/lists afterward, the downloaded package index stays inside the image. It is dead weight that ships to every pull and never gets used at runtime.
How to fix it
In the same RUN as the install, append && rm -rf /var/lib/apt/lists/* so the cleanup lands in the same layer (cleaning in a later layer does not shrink the image). Run apt-get update, install, and cleanup together in one RUN.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo