What is the difference between KILL and STOP commands?

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

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>

Buy Me A Coffee

Found this article helpful? Please consider supporting!

Ram
Ram

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity. You can connect with me on Medium, Twitter or LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *