Skip to content

hadolint/DL3030

Use the -y switch to avoid manual input: yum install -y <package>.

Property Value
Severity Warning
Category Best Practice
Default Enabled
Auto-fix Yes (--fix)

Description

Without the -y flag or the equivalent --assumeyes flag, yum will not successfully install a package because human input is expected. In a Dockerfile RUN instruction there is no interactive terminal, so the build will fail.

Examples

Problematic code

FROM centos
RUN yum install httpd-2.24.4 && yum clean all

Correct code

FROM centos
RUN yum install -y httpd-2.24.4 && yum clean all

Auto-fix

Adds -y flag to yum install, groupinstall, localinstall, and reinstall commands.

Reference