Skip to content

Instantly share code, notes, and snippets.

@parabuzzle
Created August 17, 2015 17:09
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 parabuzzle/db0f2338899331c3afa9 to your computer and use it in GitHub Desktop.
Save parabuzzle/db0f2338899331c3afa9 to your computer and use it in GitHub Desktop.
function duse {
_ENV=`docker-machine env $@`
if [ $? -ne 0 ]; then
printf "$_ENV"
return 1
elif [ -z "$1" ]; then
printf "$_ENV"
else
eval $_ENV
docker-machine active $1 > /dev/null 2> /dev/null
fi
echo "Switched to $DOCKER_HOST docker environment."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment