Skip to content

Instantly share code, notes, and snippets.

@clairvy
Last active August 29, 2015 13:57
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 clairvy/9719817 to your computer and use it in GitHub Desktop.
Save clairvy/9719817 to your computer and use it in GitHub Desktop.
# docker
if whence -p boot2docker 2>&1 > /dev/null; then
alias boot2dockerenv="boot2docker up | awk '/export/{print \$2}'"
alias boot2dockerhost="boot2docker up | awk -F= '/export/{print \$2}'"
alias boot2dockerstatus="boot2docker status | awk '{print \$5}'"
if whence -p docker 2>&1 > /dev/null; then
function docker {
if [[ x"`boot2dockerstatus`" == x"running." ]]; then
command docker --host="`boot2dockerhost`" "$@"
else
command docker "$@"
fi
}
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment