no-interactive-commands
What it does
Section titled “What it does”Reports a RUN that calls ssh, vim, shutdown, service, ps, free, top, kill or mount.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”FROM alpine:3...RUN service nginx start...RUN wget -q https://example.com/f...Configuration
Section titled “Configuration”dockerfile: lint: rules: no-interactive-commands: warn # off (default), warn, errorEnabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line no-interactive-commands in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| hadolint | DL3001 |
full |