STOPSIGNAL
The Dockerfile instruction that sets which signal docker stop sends to the container's main process.
In more detail
The default is the termination signal, so the instruction mostly documents the shutdown contract or changes it for programs that expect another signal. Docker waits for the grace period after sending it, then sends the kill signal.
Example
STOPSIGNAL SIGTERMRelated terms
- SIGTERM — The signal that politely asks a process to finish its work and exit.
- SIGKILL — The signal that ends a process immediately; it cannot be caught or ignored.
- graceful shutdown — Stopping a service in an orderly way: finish current work, close connections, then exit.
- docker stop — Asks a running container to shut down cleanly, then forces it if it does not.
Taught in
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers
- Twelve Lines, Ten Warnings: Dockerfile Instructions And hadolint — Docker Certified Associate (DCA) Exam Prep