Skip to main content

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