-y switch to avoid manual input: dnf install -y <package>.
| Property | Value |
|---|---|
| Severity | Warning |
| Category | Best Practice |
| Default | Enabled |
| Auto-fix | Yes (--fix) |
Description
Omitting the non-interactive switch causes the command to fail during the build process becausednf would expect manual input. Use the -y or the
equivalent --assumeyes flag to ensure unattended operation inside a Dockerfile.
Examples
Problematic code
Correct code
Auto-fix
Adds-y flag to dnf and microdnf install, groupinstall, and localinstall commands.