dockerfile_lint icon indicating copy to clipboard operation
dockerfile_lint copied to clipboard

False warning about lack of `yum clean all`

Open dharmit opened this issue 7 years ago • 2 comments

For this Dockerfile, one of the warning messages we get from linter is about lack of yum clean all. You can find complete logs here.

But there's already a yum clean all statement in the Dockerfile.

We use this branch of the linter to lint Dockerfiles.

dharmit avatar May 12 '17 11:05 dharmit

We're also experiencing this issue, the regex should match yum clean all anywhere in the line. I get this as output :

# Analyzing Dockerfile


-------WARNINGS--------

Line 32: -> RUN yum remove -y       wget &&     yum clean all &&     rpm -e --nodeps yum &&     rm -f /usr/bin/rpm
WARNING: yum clean all is not used. the yum cache will remain in this layer making the layer unnecessarily large.
Reference -> http://docs.projectatomic.io/container-best-practices/#_clear_packaging_caches_and_temporary_package_downloads

Shell Syntax Check.......................................................Passed
Hadolint (Dockerfile linter).............................................Passed
make: *** [lint] Error 1

Is there a way of fixing this or excluding this rule?

ghost avatar Jun 21 '18 23:06 ghost

I have the same :(

dawidmalina avatar Jan 01 '19 23:01 dawidmalina