DL3014: Use the -y switch for apt-get install
Warning Efficiency
Why This Matters
apt-get install without -y (or --yes) 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 causes silent build failures that are difficult to diagnose. Always use -y to auto-confirm installations.
How to Fix
Add -y flag to apt-get install
Before (incorrect)
RUN apt-get install curl After (correct)
RUN apt-get install -y curl Rule Details
- Rule Code
- DL3014
- Severity
- Warning
- Category
- Efficiency
Related Rules
DL3003 Warning
Use WORKDIR to switch directories
DL4006 Warning
Set the SHELL option -o pipefail before RUN with a pipe in
DL3042 Warning
Avoid use of cache directory with pip
DL3059 Info
Multiple consecutive RUN instructions
DL3015 Info
Avoid additional packages by specifying --no-install-recommends