Created
July 5, 2016 22:24
-
-
Save danielbdias/e1c0ce5d717a16d93367f1780b73ca82 to your computer and use it in GitHub Desktop.
Bash script to initialize docker-machine and import docker env in OS X
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
export DOCKER_DEFAULT_MACHINE_NAME=default | |
#check if docker-machine is Stopped | |
export DOCKER_MACHINE_STATUS="$(docker-machine status $DOCKER_DEFAULT_MACHINE_NAME)" | |
if [ $DOCKER_MACHINE_STATUS = "Stopped" ]; then | |
echo "Starting docker-machine..." | |
docker-machine start $DOCKER_DEFAULT_MACHINE_NAME | |
fi | |
#add docker env | |
eval $(docker-machine env $DOCKER_DEFAULT_MACHINE_NAME) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment