Created
September 8, 2015 06:32
-
-
Save toricls/14059a108cea78ae28bb to your computer and use it in GitHub Desktop.
Use Docker Toolbox with simple commands like boot2docker
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
# | |
# Add code below at the bottom of your zshrc/bashrc. | |
# You can use Docker Toolbox with simple commands like boot2docker. | |
# Notice: This script can handle only `default` machine. | |
# | |
# e.g. | |
# b2d start | |
# b2d ssh | |
# b2d stop | |
# | |
# Set env values for new shell | |
if [ "`docker-machine status default`" = "Running" ]; then | |
eval "$(docker-machine env default)" | |
fi | |
# docker-machine command wrapper | |
b2d () { | |
if [ $# != 1 ]; then | |
echo "Phew, We need a command to run. See `docker-machine help`." | |
else | |
docker-machine $1 default | |
if [ "`docker-machine status default`" = "Running" ]; then | |
eval "$(docker-machine env default)" | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment