Skip to content

no-interactive-commands

Dockerfilesuspiciousno fixdefault: offdockerfile/hadolint

Reports a RUN that calls ssh, vim, shutdown, service, ps, free, top, kill or mount.

A build runs without a terminal and without an init system, and each RUN ends when its command returns. ssh, vim and top need a terminal. service and shutdown talk to an init system that the container does not have; a daemon started by service stops when that RUN ends, so it is not running in containers of the image. ps, free, kill and mount report on or change the temporary build sandbox, and nothing of it lasts.

Reported
FROM alpine:3
...
RUN service nginx start
...
RUN wget -q https://example.com/f
...
dockerfile:
lint:
rules:
no-interactive-commands: warn # off (default), warn, error

Enabled by the presets: dockerfile/hadolint.

Suppress one line with sudsy-disable-next-line no-interactive-commands 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 DL3001 full