Last active
October 29, 2020 12:42
-
-
Save zulhfreelancer/27020de0c53931104fbcb37bc4288d8b to your computer and use it in GitHub Desktop.
Docker Machine — bash function to start Docker Engine (daemon) in VirtualBox and sets environment variables for Docker Client (running on host)
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
# If Docker Engine in Virtualbox is running, set Docker client environment variables | |
if [ "$(docker-machine status default)" = "Running" ] | |
then | |
eval $(docker-machine env) | |
fi | |
# Start Docker Engine function | |
docker-engine-start () { # <-- if that's too long, you can go with just `des` | |
echo "================================" | |
echo "Starting Docker Machine..." | |
echo "================================" | |
docker-machine start | |
echo "================================" | |
echo "Setting env for Docker Client..." | |
echo "================================" | |
eval $(docker-machine env) | |
echo "Done!" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment