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.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.