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

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

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.

Subscribe
Notify of
guest

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

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x