Skip to content

Instantly share code, notes, and snippets.

@EdHurtig
Created August 21, 2015 19:07
Show Gist options
  • Save EdHurtig/c1bd387dcf7c9caea132 to your computer and use it in GitHub Desktop.
Save EdHurtig/c1bd387dcf7c9caea132 to your computer and use it in GitHub Desktop.
Overrides the docker command and ensures that the default docker-machine is running before running the actual docker command
function docker() {
if [ `docker-machine status default` != "Running" ]; then
echo "WARNING! Starting Default Docker Machine."
docker-machine start default | logger
eval "$(docker-machine env default)"
fi
command docker $@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment