The docker stop
and docker kill
commands have the following differences:
docker stop
attempts to gracefully shutdown container(s) whiledocker kill
(by default) immediately stops/terminates them;docker stop
issues aSIGTERM
signal to the main process inside the container, whiledocker kill
(by default) issues aSIGKILL
signal;- With
docker kill
, you may specify to send a different signal (to the main process inside the container) than the defaultSIGKILL
signal, using the--signal
flag. Same thing is not possible with thedocker stop
command; - With
docker stop
, the container(s) must comply to the shutdown request within a (configurable) grace period (which defaults to10
seconds), after which it forcibly tries to kill the container.docker kill
does not have any such timeout period.
Hope you found this post useful. It was published . Please show your love and support by sharing this post.