Review dnf installation prompts

Automate dnf confirmation and test that builds complete without input.

Description

dnf install can ask whether to proceed. An unattended image build can stop at that prompt.

Potential impact

A failed installation delays delivery of the image, including builds needed for recovery.

Remediation

Use dnf install -y or --assumeyes for the packages you intend to install. Keep signature verification enabled. Chain dnf clean all with && in the same RUN step so cleanup follows a successful install.

Examples

The example installs nginx on Fedora 40. For your build, use a supported Fedora image and repository, then check the build log for additional prompts, dependency errors, or network failures.

Before

dockerfile
FROM fedora:40

RUN dnf install nginx

After

dockerfile
FROM fedora:40

RUN dnf install -y nginx \
    && dnf clean all

References