Last active
August 31, 2015 17:57
-
-
Save shanesveller/8e193cb6243fe389ecd6 to your computer and use it in GitHub Desktop.
ZSH lazy-loading of Docker/Docker-Compose via Docker-Machine/Docker-Toolbox
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
docker() { | |
unset -f docker | |
VBoxManage list runningvms | grep -E "^\"dev\"" >/dev/null 2>/dev/null || docker-machine start dev | |
eval "$(docker-machine env dev)" | |
docker "$@" | |
} | |
fig() { | |
unset -f fig | |
eval "$(docker-machine env dev)" | |
alias fig="docker-compose" | |
docker-compose "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment