Last active
March 9, 2016 23:02
-
-
Save justsml/d2937fcb9dc1b4dfa1c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
set -e | |
# Tested on Mac OSX | |
# Local IP changes on every network you connect to (via dhcp) | |
export LOCAL_IP=`ifconfig en0 | grep 'inet ' | awk '{ print $2; }' 2>/dev/null` | |
# This is the 'Bridge' (virtual switch) from virtualbox - only visible from your local PC | |
export BRIDGE_IP=`ifconfig vboxnet0 | grep 'inet ' | awk '{ print $2; }' 2>/dev/null` | |
export DOCKER_HOST_IP=`docker-machine ip default` | |
# Default '$LAN_HOST_IP' to the bridge IP, but use lan ip if vbox isn't there - shouldn't really be the case if you have docker-toolbox running on a mac | |
export LAN_HOST_IP=${BRIDGE_IP-LOCAL_IP} | |
export ALT_MONGO=${BRIDGE_IP-LOCAL_IP} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment