Skip to content

no-apt

Dockerfilesuspiciousno fixdefault: offdockerfile/hadolint

Reports a RUN that calls apt; use apt-get or apt-cache instead.

apt is made for people at a terminal: its output and options may change between versions, and it prints a warning that it has no stable command line interface and should be used with caution in scripts. apt-get and apt-cache keep an interface that scripts can rely on.

Reported
...
RUN apt update
...
RUN wget -q https://example.com/f
...
dockerfile:
lint:
rules:
no-apt: warn # off (default), warn, error

Enabled by the presets: dockerfile/hadolint.

Suppress one line with sudsy-disable-next-line no-apt in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
hadolint DL3027 full