Created
August 7, 2015 13:29
-
-
Save white-gecko/a7e31d6eee879b9cf179 to your computer and use it in GitHub Desktop.
Docker environment management with $DOCKER_ENV
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
#!/bin/bash | |
list () | |
{ | |
echo "local" | |
echo "remote1" | |
} | |
env_remote1 () | |
{ | |
export DOCKER_HOST="remote1.org:2375" | |
export DOCKER_TLS_VERIFY="1" | |
export DOCKER_CERT_PATH="$HOME/mydockerkeys/remote1/" | |
} | |
env_local () | |
{ | |
export DOCKER_HOST="unix:///var/run/docker.sock" | |
export DOCKER_TLS_VERIFY="" | |
export DOCKER_CERT_PATH="" | |
} | |
env_${DOCKER_ENV} | |
if [ $1 == "list-env" ] | |
then | |
list | |
else | |
/usr/bin/docker $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Moved to https://github.com/white-gecko/docker-env