Skip to content

Instantly share code, notes, and snippets.

@armand1m
Created March 24, 2016 14:03
Show Gist options
  • Save armand1m/381a9be51c2a4bc1f7e5 to your computer and use it in GitHub Desktop.
Save armand1m/381a9be51c2a4bc1f7e5 to your computer and use it in GitHub Desktop.
automating docker-machine environment
# put it on your .bash_profile or .zshrc
dck_status=$(docker-machine status)
if [ $dck_status == "Stopped" ]; then
echo "sdck ~ starting docker-machine..."
docker-machine start
echo "sdck ~ setting environment.."
eval $(docker-machine env)
else
echo "sdck ~ docker-machine is running."
echo "sdck ~ setting environment.."
eval $(docker-machine env)
fi
echo "sdck ~ finished."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment