Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker: Error response from daemon: connection error: desc = "transport: dial unix:///var/run/docker/containerd/docker-containerd.sock: timeout"

Tags:

docker

When I try to kill the Docker daemon by:

docker kill $(docker ps -q)

I get the following error:

Error response from daemon: Cannot kill container: cf5fc4b0e5d1: Cannot kill container cf5fc4b0e5d152a7a89682d8835c40c59e9e0c2c41be4aae330ffeb8093814f2: connection error: desc = "transport: dial unix:///var/run/docker/containerd/docker-containerd.sock: timeout": unknown
Error response from daemon: Cannot kill container: 590fab6b49a2: Cannot kill container 590fab6b49a2e3c832a99074a0679558a9f826d79e94bae7be4ca12c3a019b69: connection error: desc = "transport: dial unix:///var/run/docker/containerd/docker-containerd.sock: timeout": unknown

When I try to stop the Docker daemon by:

docker stop $(docker ps -q)

I get this error:

Error response from daemon: cannot stop container: cf5fc4b0e5d1: Cannot kill container cf5fc4b0e5d152a7a89682d8835c40c59e9e0c2c41be4aae330ffeb8093814f2: connection error: desc = "transport: dial unix:///var/run/docker/containerd/docker-containerd.sock: timeout": unknown
Error response from daemon: cannot stop container: 590fab6b49a2: Cannot kill container 590fab6b49a2e3c832a99074a0679558a9f826d79e94bae7be4ca12c3a019b69: connection error: desc = "transport: dial unix:///var/run/docker/containerd/docker-containerd.sock: timeout": unknown

What is the proper way to stop the Docker daemon?

like image 562
shriyash Lakhe Avatar asked Jan 05 '18 14:01

shriyash Lakhe


3 Answers

You need to stop the Docker daemon first and then start it.

To stop the Docker daemon:

sudo /etc/init.d/docker stop

To start the Docker daemon:

sudo /etc/init.d/docker start

This will reset Docker, after which all the commands should work properly.

If the above commands do not work, then just reboot:

sudo reboot

like image 156
shriyash Lakhe Avatar answered Nov 10 '22 11:11

shriyash Lakhe


For macOS users: if you get the macOS equivalent:

ERROR: dial unix docker.raw.sock: connect: connection refused

You can restart Docker with the following:

enter image description here

like image 21
mikemaccana Avatar answered Nov 10 '22 13:11

mikemaccana


I would suggest to run systemctl status docker and then either:

systemctl stop docker
systemctl start docker

Then verify whether docker daemon is up correctly or not with systemctl status docker.

like image 2
Abhishek Jain Avatar answered Nov 10 '22 11:11

Abhishek Jain