Closed Fenntasy closed 7 years ago
Copied from https://github.com/getcarina/dvm/issues/139#issuecomment-257882854
Halp, I forgot the version
The user has a docker host somewhere that was setup months ago and now they don't remember which docker version it has (and they aren't using Carina which provides $DOCKER_VERSION
).
dvm use
command...What the user really wanted was dvm detect
which would hit the docker api (/version
) figure out what version their host is using, and update them to the right version of docker transparently.
dvm detect
uses the DOCKER_HOST
and DOCKER_CERT_PATH
variables to connect to the Docker API. Using /version
, it gets the docker version from the the Version
field in the response (below). It then exports DOCKER_VERSION
and executes a dvm use
under the covers to update to the right Docker client.
{
"Version": "1.5.0",
"Os": "linux",
"KernelVersion": "3.18.5-tinycore64",
"GoVersion": "go1.4.1",
"GitCommit": "a8a31ef",
"Arch": "amd64",
"ApiVersion": "1.19"
}
@Fenntasy This feature is now in dvm 0.7.0, you can run dvm upgrade
to get it. 🍰
$ dvm detect
1.10.3 is not installed. Installing now...
Installing 1.10.3...
Now using Docker 1.10.3
It would maybe require to maintain a list of client API version but wouldn't it be useful to have a command like
dvm use-client 1.22
which would know where to switch?