Search code examples
dockerdocker-composecontainersdevops

Cannot kill container: <container-id>: tried to kill container, but did not receive an exit event


I cannot stop, remove or kill my docker container. Commands given below with their respective error messages:

1. docker stop <container-id>
2. docker kill <container-id>
3. docker rm <container-id>

I get

1. Error response from daemon: cannot stop container: <container-id>: tried to kill container, but did not receive an exit event
2. Error response from daemon: cannot kill container: <container-id>: tried to kill container, but did not receive an exit event
3. Error response from daemon: You cannot remove a running container <container-id>. Stop the container before attempting removal or force remove

Same error messages if i prefix everything with sudo and also the same messages if I run all of commands above with --force. How do I solve this? It seems like I can't stop, kill or remove the container because it does not "receive an exit event". Nothing here helps: Error response from daemon: cannot stop container - signaling init process caused "permission denied" .


Solution

  • I used wilon's answer from https://forums.docker.com/t/restart-docker-from-command-line/9420/2

    I ran killall Docker && open /Applications/Docker.app

    Once that was done, I ran docker-compose down and all containers stopped as expected.