DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for 🐳 Debugging Docker Engine Connection Issues on MacOS
Justin
Justin

Posted on

🐳 Debugging Docker Engine Connection Issues on MacOS

So I was working on adding an insecure local registry to push images to and I managed to bomb my local docker installation.

The Docker desktop app wouldn't pull up at all and I couldn't find any logs or even find docker running with something like

ps aux | grep docker
Enter fullscreen mode Exit fullscreen mode

And I kept getting this error;

$ docker ps

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Enter fullscreen mode Exit fullscreen mode

So after enough googling, I found the place the logs were stored was around ~/Library/Containers/com.docker.docker/Data/log/, it was this log specifically that lead me to the right place:

cat ~/Library/Containers/com.docker.docker/Data/log/vm/docker.log
Enter fullscreen mode Exit fullscreen mode

This showed:

...
2021-12-12T16:45:46Z docker time="2021-12-12T16:45:46Z" level=error msg="(5c94f517) 0ff224fd-DockerdPKG C<-S a2f49a7f-VMAPI GET /engine/daemon.json (9.946583ms): while parsing JSON from /Users/justin/.docker/daemon.json: invalid character '\"' after object key:value pair"
...
Enter fullscreen mode Exit fullscreen mode

Ah! I made a typo when updated my daemon.json to allow an insecure repository! After patching that up, I needed a way to restart docker:

killall Docker && open /Applications/Docker.app
Enter fullscreen mode Exit fullscreen mode

After that, it was all ready to go! Hopefully it helps you track down any issues for you!

Top comments (0)

The Complete Guide to Full Stack Web3 Development

>> Check out this classic DEV post <<