Skip to main content

DL3038: Use the -y switch for dnf install

Warning Best Practice

Why This Matters

dnf install without -y prompts for confirmation interactively. Since there is no terminal to respond during a Docker build, the build will hang or fail. In CI/CD pipelines, this results in silent build failures. Always use -y to auto-confirm package installations.

How to Fix

Add -y flag to dnf install

Before (incorrect)

RUN dnf install httpd

After (correct)

RUN dnf install -y httpd

Rule Details

Rule Code
DL3038
Severity
Warning
Category
Best Practice

Related Rules