Skip to content
Latchkey

Docker "STOPSIGNAL" - "invalid signal" in the Dockerfile in CI

A STOPSIGNAL instruction named a signal Docker does not recognize. The value must be a valid signal name (with or without SIG) or a valid signal number - anything else fails the build.

What this error means

The build (or container create) fails with invalid signal: <value>, naming the STOPSIGNAL you set. It is deterministic - the value is simply not a valid signal.

docker build output
ERROR: failed to solve: invalid signal: SIGTREM
# STOPSIGNAL SIGTREM   (typo of SIGTERM)
# or an out-of-range number: STOPSIGNAL 99

Common causes

Misspelled or unknown signal name

A typo (SIGTREM) or a non-existent signal name is rejected. Docker validates the value against known signals.

Out-of-range or non-numeric signal number

A numeric STOPSIGNAL must be a valid signal number for the platform. A number outside the valid range fails validation.

How to fix it

Use a valid signal name or number

Set STOPSIGNAL to a real signal - name (with or without SIG) or number.

Dockerfile
STOPSIGNAL SIGTERM
# equivalents:
# STOPSIGNAL TERM
# STOPSIGNAL 15

Match STOPSIGNAL to how your app shuts down

Pick the signal your process handles for graceful shutdown.

Dockerfile
# if your app traps SIGQUIT for a clean stop:
STOPSIGNAL SIGQUIT

How to prevent it

  • Use canonical signal names (SIGTERM, SIGQUIT) or valid numbers.
  • Set STOPSIGNAL to a signal your app handles for graceful shutdown.
  • Lint Dockerfiles to catch typos in instruction values.

Frequently asked questions

What causes ""invalid signal""?
A typo (SIGTREM) or a non-existent signal name is rejected. Docker validates the value against known signals.
How do I fix "invalid signal"?
Set STOPSIGNAL to a real signal - name (with or without SIG) or number.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card