Created
June 25, 2020 08:50
-
-
Save MatteoOreficeIT/14ee895304f97386edd1e626a5829cc7 to your computer and use it in GitHub Desktop.
Create, start and setup a new docker-machine instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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