mineshaftgap / d4m-nfs

Docker for Mac with NFS for performance improvements over osxfs
295 stars 26 forks source link

Detecting IP of Docker host for NFS mount #2

Closed fuerst closed 7 years ago

fuerst commented 7 years ago

At my setup (fresh Docker for Mac 1.12.1, OS X 10.11) the route command in d4m-nfs.sh returns localhost for the default gateway instead of the IP of the gateway. Trying to NFS mount from localhost fails of course.

Solution: the command /sbin/ip route|awk '/default/ { print $3 }' returns the IP of the gateway.

(Courtesy of http://stackoverflow.com/questions/22944631/how-to-get-the-ip-address-of-the-docker-host-from-inside-a-docker-container.)

if-kenn commented 7 years ago

@fuerst just updated to use your method. Strange we were getting different results since I have the same versions of D4M and OSX. Thanks!