DL3032 · hadolint/hadolint Wiki · GitHub
Skip to content
Moritz Röhrich edited this page Oct 6, 2020 · 1 revision

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.

Clone this wiki locally