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

100% binary dvm #159

Open
carolynvs opened this issue Mar 10, 2017 · 2 comments
Open

100% binary dvm #159

carolynvs opened this issue Mar 10, 2017 · 2 comments

Comments

@carolynvs
Copy link
Collaborator

carolynvs commented Mar 10, 2017

The hardest part of maintaining dvm has been trying to not break all the different shells out there. 😊

I think it's possible to have dvm be 100% a binary, without shell shenanigans. Next to the dvm binary will live a shim Docker client binary. The shim understands the DOCKER_VERSION environment variable and uses it to determine the appropriate target Docker binary. For example, when DOCKER_VERSION=1.13.0 the shim will proxy to ~/.dvm/bin/docker/1.13.0/docker.

The desired user workflow looks like this:

  1. Install dvm by copying the dvm binary and docker shim binary into ~/.dvm. (mostly the same as now)
  2. Add ~/.dvm to PATH. (instead of sourcing dvm.sh)
  3. Set DOCKER_*connection environment variables, e.g. DOCKER_HOST. Leave empty to talk to the local Docker daemon. (same as now)
  • If DOCKER_VERSION is already set, you can skip calling dvm entirely!
  • If you don't know the version up-front, use the new detect command to discover it and set DOCKER_VERSION.
  1. Use the docker shim binary as you would the regular docker binary. The shim will handle getting the right docker binary downloaded via dvm if it's missing.
eval $(dvm detect)
docker ps

My hope is not only does this simplify dvm, but also makes it easier to use, and the other commands, wouldn't be needed by most people.

As part of this issue, I'll look into proving out if the shim theory will work or not.

@carolynvs
Copy link
Collaborator Author

This would work great on mac and linux, but not Windows. Windows doesn't support exec and would still require wrapper scripts.

@loot-king
Copy link

👍

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

No branches or pull requests

2 participants