Skip to content

Instantly share code, notes, and snippets.

@shanesveller
Last active August 31, 2015 17:57
Show Gist options
  • Save shanesveller/8e193cb6243fe389ecd6 to your computer and use it in GitHub Desktop.
Save shanesveller/8e193cb6243fe389ecd6 to your computer and use it in GitHub Desktop.
ZSH lazy-loading of Docker/Docker-Compose via Docker-Machine/Docker-Toolbox
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