Debug School

Ankit Aggarwal
Ankit Aggarwal

Posted on

Diff between docker stop and docker kill?

Docker stop command stops the container gracefully and safely. It is not abruptly shut the containers. In this case four events triggers kill, die, disconnect network and stop container. It will send SIGTERM signal(28). If in case if it couldn't stop container in certain time then it kills the container.

docker stop containerid

Image description

Docker kill command kills the container abruptly and in unsafe manner. It will directly kills the container and send 3 events which are kill, die and disconnect network. It actually send SIGKILL(9) signal to kill container immediately

docker kill containerid

Image description
All events can be tracked by running

docker events command

Top comments (1)

ankit1601 profile image
Ankit Aggarwal

@rajesh_kumar please find the difference above