I need to setup a debugger on my container, that requires me to set the remote (docker host) IP. In different tutorials I find different IP addresses listed as possible solution. In my container I ran a webserver that showed me that connections made to the container from my host machine come from 172.19.0.1
. This is on Docker for Mac version 1.11.x
.
But how would I reliably find out the host IP as seen from the container on Docker for Mac? When would it be possible for this IP to change?
Edit: Duplicate of https://stackoverflow.com/a/24716645/6309
You can get the ip of the host from within the container by running this command:
/sbin/ip route|awk '/default/ { print $3 }'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With