docs icon indicating copy to clipboard operation
docs copied to clipboard

STOPSINGAL

Open cod3mas0n opened this issue 5 months ago • 0 comments

Is this a docs issue?

  • [x] My issue is about the documentation content or website

Type of issue

Other

Description

It might be helpful to clarify in the documentation that the STOPSIGNAL instruction is specifically used when a container is stopped via docker stop.

Currently, someone might assume that this signal is also used when stopping a foreground container with Ctrl + C, but in that case, the signal sent is actually SIGINT, not the one specified via STOPSIGNAL.

Since both docker stop and Ctrl + C can be used to terminate a container, this detail might be confusing at first glance. Explicitly noting the difference in signal handling would help avoid misunderstandings.

Location

https://docs.docker.com/reference/dockerfile/

Suggestion

The STOPSIGNAL instruction sets the system call signal that will be sent to the container to exit with `docker container stop` or `docker stop`. This signal can be a signal name in the format SIG<NAME>, for instance SIGKILL, or an unsigned number that matches a position in the kernel's syscall table, for instance 9. The default is SIGTERM if not defined.

The image's default stopsignal can be overridden per container, using the --stop-signal flag on docker run and docker create

cod3mas0n avatar Jul 22 '25 20:07 cod3mas0n