Skip to content

Instantly share code, notes, and snippets.

@justsml
Last active March 9, 2016 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justsml/d2937fcb9dc1b4dfa1c7 to your computer and use it in GitHub Desktop.
Save justsml/d2937fcb9dc1b4dfa1c7 to your computer and use it in GitHub Desktop.
#/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