docker stop and
docker kill commands have the following differences:
docker stopattempts to gracefully shutdown container(s) while
docker kill(by default) immediately stops/terminates them;
docker stopissues a
SIGTERMsignal to the main process inside the container, while
docker kill(by default) issues a
docker kill, you may specify to send a different signal (to the main process inside the container) than the default
SIGKILLsignal, using the
--signalflag. Same thing is not possible with the
docker stop, the container(s) must comply to the shutdown request within a (configurable) grace period (which defaults to
10seconds), after which it forcibly tries to kill the container.
docker killdoes 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.