Skip to content

Instantly share code, notes, and snippets.

@kiyohara
Created July 9, 2014 05:11
Show Gist options
  • Save kiyohara/bbf5212f9386c8dd3981 to your computer and use it in GitHub Desktop.
Save kiyohara/bbf5212f9386c8dd3981 to your computer and use it in GitHub Desktop.
boot2docker 環境を zsh から触るときに毎回 DOCKER_HOST を export するのがめんどくさい人向け .zshrc
### 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