Skip to content

dnf-yes

Dockerfilecorrectnessno fixdefault: warndockerfile/hadolint

Reports a dnf install, dnf groupinstall or dnf localinstall (also with microdnf) without -y or --assumeyes.

Before it installs, dnf asks Is this ok [y/N]. A build has no terminal to answer, so dnf aborts with Operation aborted and the RUN fails.

Reported
...
RUN yum install -y curl-7.0 && yum clean all
RUN yum install -y curl-7.0 && rm -rf /var/cache/yum/*
RUN yum install -y nginx-1.2 && yum clean all
RUN dnf install curl
...
RUN dnf install -y curl-7.0 && dnf clean all
...
dockerfile:
lint:
rules:
dnf-yes: warn # off, warn (default), error

Enabled by the presets: dockerfile/hadolint.

Suppress one line with sudsy-disable-next-line dnf-yes in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
hadolint DL3038 full