Skip to content

STOPSINGAL #23140

@cod3mas0n

Description

@cod3mas0n

Is this a docs issue?

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/buildRelates to Dockerfiles or docker build commandkind/enhancementImproves the usability of docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions