Created
July 9, 2014 05:11
-
-
Save kiyohara/bbf5212f9386c8dd3981 to your computer and use it in GitHub Desktop.
boot2docker 環境を zsh から触るときに毎回 DOCKER_HOST を export するのがめんどくさい人向け .zshrc
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
### boot2docker ### | |
if command -v boot2docker &>/dev/null; then | |
function __boot2docker_init() { | |
boot2docker init | |
boot2docker up && export DOCKER_HOST=tcp://$(boot2docker ip 2>/dev/null):2375 | |
docker version | |
} | |
function __docker() { | |
if [[ ! -n "${DOCKER_HOST}" ]]; then | |
__boot2docker_init | |
fi | |
docker $@ | |
} | |
alias docker='__docker' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment