Ensure delete installations lists after installation by 'apt'

When you clean up the apt cache by removing /var/lib/apt/lists it reduces the image size, since the apt cache is not stored in a layer. Since the RUN statement starts with apt-get update, the package cache is always refreshed prior to apt-get install.

Risk Level: informational
Platform: Docker
Spectral Rule ID: DOCKR003

REMEDIATION

For each RUN command that use apt install, finish with removing apt lists folder.

RUN apt-get update && apt-get install -y \
aufs-tools \
automake \
... \
+ && rm -rf /var/lib/apt/lists/*

Read more: