KILL and STOP are two commands in docker used to stop a container from execution. A docker STOP command issues a SIGTERM signal to the main process running within the container, while KILL command issues a SIGKILL signal to the process.
- docker STOP leads to a safe exit
- docker KILL leads to an unsafe exit
- if a process doesn’t exit for a STOP command within a specified timeout, docker issues a KILL command implicitly.
> docker stop|kill <container_id>