What is the STOPSIGNAL instruction good for in Docker?
Experience Level: Senior
Tags: Docker
Answer
The STOPSIGNAL instruction sets the system call signal that will be sent to the container to exit. 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.
Example:
STOPSIGNAL SIGKILL
Related Docker job interview questions
What is a difference between COPY and ADD instructions in Docker?
Docker SeniorWhat is the ADD instruction good for in Docker?
Docker SeniorWhat is the SHELL instruction good for in Docker?
Docker SeniorHow do ENTRYPOINT and CMD instructions interact?
Docker SeniorHow many CMD instructions can be in a Dockerfile?
Docker Senior