Skip to main content
Use the -y switch.
PropertyValue
SeverityWarning
CategoryBest Practice
DefaultEnabled
Auto-fixYes (--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