Skip to content

Instantly share code, notes, and snippets.

@gamlerhart
Last active July 7, 2016 03:34
Show Gist options
  • Save gamlerhart/263c05fa68cff94b754df3bf55deab4d to your computer and use it in GitHub Desktop.
Save gamlerhart/263c05fa68cff94b754df3bf55deab4d to your computer and use it in GitHub Desktop.
triton-intro
gamlor@minty ~ $ triton profile create
A profile name. A short string to identify a CloudAPI endpoint to the
`triton` CLI.
name: us-west-1
The CloudAPI endpoint URL.
url: https://us-west-1.api.joyent.com
Your account login name.
account: Gamlor
The fingerprint of the SSH key you have registered for your account.
Alternatively, You may enter a local path to a public or private SSH key to
have the fingerprint calculated for you.
keyId: ~/.ssh/id_rsa
Fingerprint: 07:9a:a5:c8:07:82:72:82:63:ce:5b:e3:e6:bf:83:61
Saved profile "us-west-1".
Setting up profile "us-west-1" to use Docker.
Setup profile "us-west-1" to use Docker (v1.10.3). Try this:
eval "$(triton env --docker us-west-1)"
docker info
Set "us-west-1" as current profile (because it is your only profile).
#Let's nginx
roman@minty ~ $ docker run -d -p 80 --name blog-server nginx
Unable to find image 'nginx:latest' locally
latest: Pulling from nginx (req 49871310-4381-11e6-8f6a-1d7cd58ced5b)
6685b2154893: Already exists
a2295636c7aa: Already exists
3035387b9e83: Already exists
963493e54e68: Already exists
968c69f18673: Already exists
755b4eb93a9e: Already exists
f3b2532b0301: Already exists
f3bf4daa2ff2: Already exists
Digest: sha256:1fd7247f7bdb19ab1ccabb53ec5ecfa31e2ea39a24dfe636f78265980f4eebfb
Status: Image is up to date for nginx:latest
4f0cb241c17b4de4ad7e8c813f0d48c19a5c209a8eae4ce19e142770684adb5
#Check it running
roman@minty$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4f0cb241c17b nginx "nginx -g 'daemon off" 2 minutes ago Up About a minute 0.0.0.0:80->80/tcp, 443/tcp blog-server
#What IP do we have?
roman@minty$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' blog-server
8.19.33.77
sudo npm install triton -g
roman@minty ~ $ docker rm -f blog-server
blog-server
#What enviroment will be setup
gamlor@minty ~ $ triton env
#Ok...let's set it up
gamlor@minty ~ $ eval $(triton env)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment