Skip to content

Instantly share code, notes, and snippets.

@n0b0dy
Created September 16, 2016 08:27
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 n0b0dy/0d05b447f83c61fef641fdf8e51451e2 to your computer and use it in GitHub Desktop.
Save n0b0dy/0d05b447f83c61fef641fdf8e51451e2 to your computer and use it in GitHub Desktop.
dm(){
case $1 in
use)
if [ -n "$2" ]
then
eval "$(docker-machine env $2)"
else
echo "Host does not empty"
fi
;;
*) docker-machine $*;;
esac
}
compdef dm=docker-machine
docker(){
if [ -z "$DOCKER_MACHINE_NAME" ]
then
eval $(docker-machine env)
fi
/usr/local/bin/docker $*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment