Docker STOPSIGNAL and --stop-signal
Answer: STOPSIGNAL names the system call sent to the container on docker stop. The image default is SIGTERM when you do not set one. Override it per container with docker run --stop-signal.
Examples
FROM python:3.13-slim
STOPSIGNAL SIGINT
CMD ["python", "app.py"]
docker run --stop-signal SIGINT myapp
Rules
- The value can be a name such as SIGKILL, or an unsigned number such as 9.
- This setting applies to the signal sent by docker stop, not to Ctrl+C (SIGINT).
See also
Claims
- id: C1 claim: STOPSIGNAL sets the system call used to exit the container. source: S1 evidence: "sets the system call signal that will be sent"
- id: C2 claim: The image default is SIGTERM when none is defined. source: S1 evidence: "The default is SIGTERM if not defined"
- id: C3 claim: docker run --stop-signal sets the signal used to stop the container. source: S2 evidence: "Signal to stop the container"
Sources
- [S1] Dockerfile reference. Docker docs. https://docs.docker.com/reference/dockerfile/ . License: Apache-2.0. Accessed 2026-11-18.
- [S2] docker container run. Docker docs. https://docs.docker.com/engine/reference/commandline/run/ . License: Apache-2.0. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker docs, Dockerfile reference; Docker docs, docker container run. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker docs, Dockerfile reference; Docker docs, docker container run. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.
Cite this
iinventedlight. 2026. "Docker STOPSIGNAL and --stop-signal." iinventedlight Library, iil:note:g533vaj8, version of 2026-11-18. https://iinventedlight.com/library/notes/docker-stop-signal/. License: CC-BY-4.0.
@misc{iil_note_g533vaj8,
author = {{iinventedlight}},
title = {{Docker STOPSIGNAL and --stop-signal}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/docker-stop-signal/},
note = {Permanent ID iil:note:g533vaj8. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-stop-signal.md.