-
-
Save reyhansofian/f79801e8ebff03ac7419fd266deca551 to your computer and use it in GitHub Desktop.
Add this to your bash script to avoid docker-machine env dev blocking your bash if dev isn't running
This file contains hidden or 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
docker_running=$(docker-machine ls | grep default) | |
if [[ "$docker_running" == *"Stopped"* ]] | |
then | |
docker-machine start | |
eval "$(docker-machine env)" | |
env | grep "DOCKER_HOST" | |
elif [[ "$docker_running" == *"Running"* ]] | |
then | |
eval "$(docker-machine env)" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment