Skip to content

Instantly share code, notes, and snippets.

@bixu
Created August 6, 2015 14:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bixu/9a912702a2f75da4820c to your computer and use it in GitHub Desktop.
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
#!/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
}
@bixu
Copy link
Author

bixu commented Aug 6, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment