> ## Documentation Index
> Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# hadolint/DL3038

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

Use the `-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 because `dnf` would expect manual input. Use the `-y` or the
equivalent `--assumeyes` flag to ensure unattended operation inside a Dockerfile.

## Examples

### Problematic code

```dockerfile theme={null}
FROM fedora:32
RUN dnf install httpd-2.4.46 && dnf clean all
```

### Correct code

```dockerfile theme={null}
FROM fedora:32
RUN dnf install -y httpd-2.4.46 && dnf clean all
```

## Auto-fix

Adds `-y` flag to `dnf` and `microdnf` `install`, `groupinstall`, and `localinstall` commands.

## Reference

* [hadolint/DL3038](https://github.com/hadolint/hadolint/wiki/DL3038)


## Related topics

- [Hadolint rules](/rules/hadolint/overview.md)
- [hadolint/DL3020](/rules/hadolint/DL3020.md)
- [hadolint/DL3021](/rules/hadolint/DL3021.md)
- [hadolint/DL3022](/rules/hadolint/DL3022.md)
- [hadolint/DL3023](/rules/hadolint/DL3023.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.