100% binary dvm
Opened this issue ยท 2 comments
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:
- Install dvm by copying the dvm binary and docker shim binary into ~/.dvm. (mostly the same as now)
- Add
~/.dvm
toPATH
. (instead of sourcing dvm.sh) - 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 setDOCKER_VERSION
.
- 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.
This would work great on mac and linux, but not Windows. Windows doesn't support exec and would still require wrapper scripts.
๐