apt-get missing –no-install-recommends

ID

no_install_recommends

Severity

high

Family

Container Security

Tags

dockerfile, non-reachable, smaller-size

Description

apt-get install or apt install should use –no-install-recommend to minimize image size.

Security

N/A

Examples

# Will install recommended packages
RUN apt-get install -y python=2.7

Mitigation / Fix

Add --no-install-recommends option to apt | apt-get install commands:

# --no-install-recommends added, to try to minimize image size
RUN apt-get install -y --no-install-recommends python=2.7