Skip to main content
STOPSIGNAL should use canonical signal names for clarity and consistency.

Description

STOPSIGNAL accepts signal names in many formats: numeric values (9, 15), names without the SIG prefix (TERM, QUIT), quoted strings ("SIGINT"), mixed case (sigterm), and non-standard real-time signal names (RTMIN+3). While Docker accepts all of these, canonical signal names are easier to read and easier to connect to upstream daemon documentation. This rule suggests the canonical form:
  • Ordinary signals: SIGTERM, SIGINT, SIGQUIT, SIGKILL, etc.
  • Real-time signals: SIGRTMIN+3
Environment variable references (e.g. STOPSIGNAL $MY_SIGNAL) are skipped because the signal value cannot be determined statically. Windows stages are skipped because STOPSIGNAL has no effect on Windows containers — POSIX signals are not delivered to Windows processes.

References

Examples

Bad

Good

Auto-fix

The fix replaces the non-canonical signal token with its canonical form:
The fix uses FixSafe safety because the canonical form is semantically identical to the original — Docker normalizes signal names internally, so no runtime behavior changes.

Configuration