Using: Netbeans 8.2, Docker Toolbox on Mac, PHP7.2
Here’s how it worked for me after three hours of trying various ideas above:
On Mac host, run sudo ifconfig lo0 alias 10.254.254.254
In php.ini (in my case, xdebug.ini inside conf.d), use:
xdebug.remote_host=10.254.254.254
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.default_enable=0
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.idekey=netbeans-xdebug (or PHPSTORM, or whatever – just needs to match in IDE setup)
In the project run configuration, I use a "Local Web Site (running on local web server) that points to the URL I have in my hosts file that points to 192.168.99.100 (docker container IP).
The advanced settings (path mapping and debugger proxy) got me sidetracked for a while. I didn’t need these as a local docker container isn’t truly a remote server.
Good luck. Time for another sip of Monster.