Skip to content

Instantly share code, notes, and snippets.

@MatteoOreficeIT
Created June 25, 2020 08:50
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 MatteoOreficeIT/14ee895304f97386edd1e626a5829cc7 to your computer and use it in GitHub Desktop.
Save MatteoOreficeIT/14ee895304f97386edd1e626a5829cc7 to your computer and use it in GitHub Desktop.
Create, start and setup a new docker-machine instance
#!/bin/bash
## NOTA: questo script non va lanciato direttamente ma incluso tramite source o .
if docker-machine status default > /dev/null ;
then
echo "Creazione default docker machine"
docker-machine create default
fi
DM_STATUS=$(docker-machine status default)
if [[ "$DM_STATUS" = "Stopped" ]] ;
then
echo "Avvio default docker machine"
docker-machine start default
fi
DM_ENV=$(docker-machine env default)
[[ "$?" -eq '0' ]] && eval "$DM_ENV"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment