3. What is the difference between docker stop and kill?

docker stop attempts to gracefully shutdown container(s) while docker kill (by default) immediately stops/terminates them;

docker stop issues a SIGTERM signal to the main process inside the container

docker kill (by default) issues a SIGKILL signal.

With docker kill, you may specify to send a different signal (to the main process inside the container) than the default SIGKILL signal, using the –signal flag. Same thing is not possible with the docker stop command.

With docker stop, the container(s) must comply to the shutdown request within a (configurable) grace period (which defaults to 10 seconds), after which it forcibly tries to kill the container. docker kill does not have any such timeout period.

0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x