Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triton help for setting up and using Docker against a Triton DC #46

Closed
misterbisson opened this issue Oct 14, 2015 · 7 comments
Closed
Assignees

Comments

@misterbisson
Copy link

Can we use triton to fill the gap we're facing without docker-machine support just now?

For example, how do we feel about setting up the proper docker environment vars using the current triton account by doing:

eval $(triton docker env)

Has this been discussed already and I missed it?

@trentm
Copy link
Contributor

trentm commented Oct 14, 2015

@misterbisson +1. Definitely room to re-imagine sdc-docker-setup.sh using triton. triton docker env or triton docker-env (with support for triton's profiles) would be fairly straightforward I think. It could do the cert setup on first run and cache the necessary data.

I also have a triton setup dream, BTW.

@misterbisson
Copy link
Author

It would be very helpful to be able to do the following to set up the Docker environment vars to use sdc-docker:

eval $(triton docker-env)

That would set the local environment based on the user's current active profile. Users can then switch back to a local docker using standard Docker Machine:

eval $(docker-machine env lappy)

This is desirable to reduce friction in initial Docker setup for Triton and when switching back and forth.

The triton syntax above intentionally omits the option of configuring the Docker environment to connect to a different data center/profile. This is to eliminate confusion that results from using docker and triton in parallel, but unintentionally connected to different DCs. @tgross and I have started to protect against that using checks like those in https://github.com/tgross/triton-touchbase/blob/master/start.sh#L55-L75, but it would be best to make the tools assume they're connecting using the same profile from the start.

@trentm
Copy link
Contributor

trentm commented Mar 18, 2016

one example of this working: https://gist.github.com/trentm/726d0e610067bf59fec5

@trentm
Copy link
Contributor

trentm commented Mar 18, 2016

Proposal:

Getting triton to help setup for Docker usage.
A.k.a. "sdc-docker-setup.sh sucks".

First time user

  1. In the browser/email, create an account with Joyent:

    https://my.joyent.com
    

    Note that this has a number of redirects (and needing to find the "Sign up"
    link) that make it more jarring than it needs to be. Having a nice
    link for signing up would be nice.

    ... presuming they are fine creating an account and being led through
    adding an SSH key
    .

  2. In the shell, install triton and setup for docker usage

    # install node/npm
    npm install -g triton
    # optionally install triton bash completion
    triton profile create   # defaults to us-sw-1
    

    Perhaps we could setup for docker during triton profile create. We already
    hit CloudAPI anyway. If CloudAPI ListServices has "docker" then we do the
    docker setup as well.

  3. Use docker:

    eval "$(triton env)"
    docker run joyent/hello-world
    

    We already have triton env to set SDC_ and TRITON_ envvars. We could
    add the DOCKER_ envvars as well.

  4. Optionally: Use triton docker to run docker without having to change
    one's environment.

    triton docker run joyent/hello-world
    

Users with triton profiles already that now want Docker setup for them

Users like me. :)

triton profile docker-setup

This would do the Docker-part of the profile setup for the current profile.
Might like to do that for another profile:

triton profile docker-setup east3b

@trentm trentm changed the title Can triton fill the docker-machine gap? Triton help for setting up and using Docker against a Triton DC Mar 18, 2016
trentm added a commit that referenced this issue Mar 18, 2016
This implements all but step #4 (`triton docker ...`) in the proposal.
@trentm
Copy link
Contributor

trentm commented Mar 18, 2016

^^^ added all but step #4 of the proposal. Given that I'm going away for a week, I don't want to push a new release until I'm back (in case this breaks people). So we'll let it soak a bit.

@trentm
Copy link
Contributor

trentm commented Mar 28, 2016

@trentm trentm closed this as completed Mar 28, 2016
@misterbisson
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants