DEV Community

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

Posted on

3 3

🐳 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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay