When the docker moved to the new engine, one of the things to go is docker0 network interface. To quote the docs on networking
I want to connect from a container to a service on the host The Mac has a changing IP address (or none if you have no network access). Our current recommendation is to attach an unused IP to the lo0 interface on the Mac; for example: sudo ifconfig lo0 alias 10.200.10.1/24, and make sure that your service is listening on this address or 0.0.0.0 (ie not 127.0.0.1). Then containers can connect to this address.
What this essentially mean is that you don't have a network address to target with xdebug.
But there is a workaround... You can either execute the following in your terminal to create a loopback interface alias to an ip address
sudo ifconfig lo0 alias 10.254.254.254 255.255.255.0
You would, of course, have to reexecute it on restarts, as this is not a permanent solution.
Or if you want a more permanent solution, you can copy the com.docker_alias.plist
file from config/osx-config
to
/Library/LaunchDaemons/com.docker_alias.plist
and from then on, on every reboot the loopback
will be setup.
To verify that everything has been setup properly, execute ifconfig
from terminal and the output
should look along the lines of this
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 10.254.254.254 netmask 0xff000000 <--- here you can see it has been setup properly
nd6 options=1<PERFORMNUD>
If you want to use a different ip, go ahead, but make a note of it, and put it into your .env
for HOST_IP
key.
The plist file is based on this gist