Home > Blockchain >  docker problem on mac terminal: ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker
docker problem on mac terminal: ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker

Time:06-28

I am using docker with k8s from mac terminal. Don't know what I have done, my docker command does not work anymore. For example, docker info and docker run... hang forever. I've tried to fix this problem by uninstalling and installing docker. But after I reinstalled docker, I got this error message:

> $ docker info Client:  Context:    default  Debug Mode: false
> 
> Server: ERROR: Cannot connect to the Docker daemon at
> unix:///var/run/docker.sock. Is the docker daemon running? errors
> pretty printing info

For other docker commands, I also received:

ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info

I've read through lots of websites (How to easily install and uninstall docker on MacOs) ("VirtualBox is configured with multiple host-only adapters with the same IP" when starting docker)..., but still unable to fix my problem. A lot of solutions do not seem to work on macos. I've seen many solved by the systemctl command, and I tried to replace that with launchctl and followed the rest of the instructions. (Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?) But none works for me. Please help solve this problem. Thank you!

CodePudding user response:

I just found out that I have to restart my docker desktop as well. I had no idea that docker desktop and terminal's docker command are related. But now, apparently, they are related. If anyone encounters similar problems, remember to try restart your docker desktop and wait for it to get running!

CodePudding user response:

chown root:docker /var/run/docker.sock    
chmod g w /var/run/docker.sock

Try to give/Modify Permission.

  • Related