1 DL3032
Moritz Röhrich edited this page 2020-10-06 22:11:07 +02:00

yum clean all missing after yum command.

Problematic code:

RUN yum install -y httpd-2.24.2

Correct code:

RUN yum install -y httpd-2.24.2 && yum clean all

Rationale:

Clean cached package data after installation to reduce image size.

https://docs.docker.com/engine/articles/dockerfile_best-practices/

Notes:

Clean up must be performed in the same RUN step, otherwise it will not affect image size.