howtowhale / dvm

Docker Version Manager
https://howtowhale.github.io/dvm/
Apache License 2.0
522 stars 50 forks source link

Option to skip checking for version #112

Closed andrefernandes closed 8 years ago

andrefernandes commented 8 years ago

Optionally ("nocheck") avoid checking if docker version exists (dvm install). Usually we go for DVM_MIRROR_URL not just for speed, but also to avoid using a cursed proxy by all means.

Current code always calls getAvailableVersions one way or another.

This PR is just an untested suggestion.

carolynvs commented 8 years ago

Thank you for adding documentation on setting up and using a mirror!

carolynvs commented 8 years ago

This is cool for even those who aren't using mirroring! I picked what I thought was a bad version number 1.6.2 and it worked, because though it wasn't an official release in GH, the docker client URL did exist for that version.

$ dvm --debug install --nocheck=false 1.6.2
dvm install 1.6.2
Version 1.6.2 not found - try `dvm ls-remote` to browse available versions.

$ dvm --debug install --nocheck=true 1.6.2
dvm install 1.6.2
Skipping version validation!
Installing 1.6.2...
Downloading https://get.docker.com/builds/Darwin/x86_64/docker-1.6.2
Downloading https://get.docker.com/builds/Darwin/x86_64/docker-1.6.2.sha256
Downloaded Docker 1.6.2 to /Users/caro8994/src/github.com/getcarina/dvm/bin/docker/1.6.2/docker.
# output truncated
Now using Docker 1.6.2

For a true bad version, the output with --nocheck still makes sense I think.

$ dvm install --nocheck 1.6.3
Installing 1.6.3...
Unable to download https://get.docker.com/builds/Darwin/x86_64/docker-1.6.3. (Status 403)

I'll get this merged and released today.

carolynvs commented 8 years ago

Alrighty, this PR has been manually merged and dvm 0.6.0 released with support for --nocheck, you can get the latest version by running dvm upgrade.

Thank you for this nifty flag!

andrefernandes commented 8 years ago

Glad I could help :)

rgbkrk commented 8 years ago

:heart: