Skip to content

Instantly share code, notes, and snippets.

@bitjockey42
Last active January 16, 2016 07:36
Show Gist options
  • Save bitjockey42/efceb07887225cbc2ba2 to your computer and use it in GitHub Desktop.
Save bitjockey42/efceb07887225cbc2ba2 to your computer and use it in GitHub Desktop.
Load docker-machine environment variables automatically
if [[ $(pgrep docker-machine-driver-xhyve) ]]; then
if [[ $(docker-machine status dev) == *"Running"* ]]; then
eval $(docker-machine env dev)
else
echo "It looks like docker-machine did not start correctly"
fi
else
echo "docker-machine dev is not running"
echo "try running: docker-machine start dev"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment