| Property | Value |
|---|---|
| Severity | Info |
| Category | Best Practice |
| Default | Enabled |
| Auto-fix | Yes (--fix) |
Description
ENTRYPOINT and CMD instructions both support shell form and exec form.
When you use shell form, the executable runs as a child process to a shell,
which doesn’t pass signals. This means that the program running in the
container can’t detect OS signals like SIGTERM and SIGKILL and respond to
them correctly.
Examples
Bad:Workarounds
If you need shell features (variable expansion, piping, command chaining), you can:- Create a wrapper script:
- Explicitly specify the shell (suppresses the warning):
Auto-fix
Fix safety:FixSuggestion — converts shell form to JSON array form.
Before:
--fix):
Related Rules
tally/invalid-json-form— detects instructions that attempt JSON exec-form but have invalid JSON (e.g., unquoted strings, single quotes). BuildKit silently falls back to shell-form for these, so both rules fire on the same instruction. tally’s supersession processor suppresses the lower-severityJSONArgsRecommended(info) wheninvalid-json-form(error) is present at the same line.