Created
August 6, 2015 14:30
-
-
Save bixu/9a912702a2f75da4820c to your computer and use it in GitHub Desktop.
Shell functions to switch between local Docker environments and Joyent's Triton Docker hosting service
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
#!/bin/bash | |
# triton/docker | |
export DOCKER_TLS_VERIFY=1 | |
function dockerlocal { | |
export DOCKER_HOST=tcp://192.168.59.103:2376 | |
export DOCKER_CERT_PATH=$HOME/.boot2docker/certs/boot2docker-vm | |
} | |
function triton { | |
export DOCKER_HOST=$(echo -n $SDC_URL | sed s/https/tcp/ | sed s/api/docker/):2376 | |
export DOCKER_CERT_PATH=$HOME/.sdc/docker/$SDC_ACCOUNT | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: This gist assumes you are already using the Joyent SDC Node CLI tools, and thus have SDC_URL and SDC_ACCOUNT environment variables configured