Skip to content

hadolint/DL3014

Use the -y switch.

Property Value
Severity Warning
Category Best Practice
Default Enabled
Auto-fix Yes (--fix)

Description

Without the --assume-yes (-y) option it might be possible that the build breaks without human intervention. Always use -y with apt-get install to avoid interactive prompts during the build.

Examples

Problematic code

FROM debian
RUN apt-get install python=2.7

Correct code

FROM debian
RUN apt-get install -y python=2.7

Auto-fix

Adds -y flag to apt-get install commands.

# Before
RUN apt-get install curl

# After (with --fix)
RUN apt-get install -y curl

Reference