1-You need to install the plugin
2- Next you will have to restart
PHPStorm, mean while you will need to install a program called
homebrew using the following command
brew install socat
3- You will have to execute the following command every time you need want to use
socat -d -d -lf /tmp/socat.txt TCP-L:2376,fork UNIX:/var/run/docker.sock
You can read more about
socat from this link.
4- Now you will have to configure
PHPStorm like the following
- You will need to add the server, configure the URL, by default it will use the old URL for Docker toolbox, and since it cant read the Unix socket which Docker for mac use, we use
socatto redirect the URL to the socket.
- You will need to add the full path for
docker-composecommand , not sure why but PHPStorm didn’t find it.
- The certification field should be removed, as this was related to the old Docker toolbox and no need for it any more.
5- To configure the debugger you should check do the following
for me, my project depend on a
docker-compose.yml file, so I choose that one.
6- Make sure that you can start / stop Docker, so from the bottom toolbox you will find the Docker icon, clicking on it will open it and clicking on the
Run button should show the images/containers that you have like
7- Run the debugger (running docker-compose) can be done like the following
And it will run
docker-compose and create the image for you, and from there you can find many valuable information about your container
Hopefully this will change later, and it will be much simpler if (and only if) PHPStorm team found a better way to implement it.