简体   繁体   中英

Issue: Cannot connect to the Docker daemon at unix:///home/tonton/.docker/desktop/docker.sock. Is the docker daemon running?

Hello Guys when I run docker version My docker compose version is: docker compose version Docker Compose version v2.2.2


 Client: Docker Engine - Community
 Version:           20.10.18
 API version:       1.41
 Go version:        go1.18.6
 Git commit:        b40c2f6
 Built:             Thu Sep  8 23:11:43 2022
 OS/Arch:           linux/amd64
 Context:           desktop-linux
 Experimental:      true
Cannot connect to the Docker daemon at unix:///home/tonton/.docker/desktop/docker.sock. Is the docker daemon running?

I am using ubuntu 22.04 version.

In my case:

  • I had installed docker desktop by apt in ubuntu20.04 before, but removed it later.
  • And when I try to check sudo docker images today there is the same issue.
  • Restarting docker, chown socket and some other strange ways don't work.
  • Suddenly I discover that there is no such socket file in docker/desktop/, but in the default location /var/run. Then trying to restore docker default context by docker context use default makes everything come back to normal.

So I think that the remained docker-desktop context takes the responsibility.....

Yes indeed docker context use default this command solved my issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM