Search code examples
dockerintellij-ideawebstormapple-m1

WebStorm Docker deamon connection error on Macbook M1


I have a MacBook M1 and installed WebStorm 2022.2.3 and installed Docker plugin. Then I installed Docker Desktop for Apple Silicon.

The Docker Desktop is working fine but in my WebStorm I got an error when I try to build a .yaml file. The error is that WebStorm cannot connect to the Docker daemon.

I’ve searched for a solution for this error online but had no luck. I installed Brew and Rosetta 2 and the issue is the same.

Has anyone had this kind of issue? Oh, I did not mention that on my Windows laptop this feature works normally :-)

enter image description here


Solution

  • Docker Desktop for Apple Silicon seems to place the socket at a different place (in the users domain, not in system domain):
    When Docker Desktop is not running, docker shows the error

    Cannot connect to the Docker daemon at unix:///Users/"your_username"/.docker/run/docker.sock. Is the docker daemon running?

    So there are two ways to solve the problem:

    1. configure TCP-Socket instead of "Docker for Mac"
      enter image description here
    2. Symlink the expected system socket path to your personal socket

      sudo ln -s /Users/your_username/.docker/run/docker.sock /var/run/

    the later is only suitable if there is only a single user using Docker an a computer so Docker Desktop is always started by the same user.

    There is no need to install another docker with brew.