docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

Downloads wrong boot2docker image #4751

Open niklasholm opened 5 years ago

niklasholm commented 5 years ago

I have Docker Toolbox 19.03.1 which includes boot2docker 19.03.1 and I've also upgraded docker-machine to 0.16.2. When creating a new Virtualbox VM docker-machine insists on downloading the "latest" release from GitHub, which is atm 18.09.9, even though it's a downgrade from 19.03.1.

$ docker-machine --version
docker-machine.exe version 0.16.2, build bd45ab13

$ sha256sum /c/Program\ Files/Docker\ Toolbox/boot2docker.iso
aaf078200dceb5c39bf7132d60f47d8a601fee8587b65c4913a73ba36be23ceb */c/Program Files/Docker Toolbox/boot2docker.iso

$ rm -r .docker/

$ mkdir -p .docker/machine/cache

$ cp -p /c/Program\ Files/Docker\ Toolbox/boot2docker.iso .docker/machine/cache/

$ docker-machine create default -d virtualbox
Creating CA: <censored>\.docker\machine\certs\ca.pem
Creating client certificate: <censored>\.docker\machine\certs\cert.pem
Running pre-create checks...
(default) Default Boot2Docker ISO is out-of-date, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v18.09.9
(default) Downloading <censored>\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.09.9/boot2docker.iso...
...
...

$ eval "$(docker-machine env default)"

$ docker version
Client:
 Version:           19.03.1
 API version:       1.39 (downgraded from 1.40)
 Go version:        go1.12.7
 Git commit:        74b1e89e8a
 Built:             Wed Jul 31 15:18:18 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.9
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.11.13
  Git commit:       039a7df9ba
  Built:            Wed Sep  4 16:55:50 2019
  OS/Arch:          linux/amd64
  Experimental:     false
afbjorklund commented 4 years ago

Looking at https://github.com/boot2docker/boot2docker/releases, v18.09.9 is indeed latest.

Even though there are several newer versions available: v19.03.0, v19.03.1, v19.03.2.

Maybe @tianon has a reason for holding it back, something similar is done for Kubernetes ?

You can select a newer boot2docker version, by setting $VIRTUALBOX_BOOT2DOCKER_URL to it.

tianon commented 4 years ago

@afbjorklund that's a quirk of GitHub's releases -- the only way I can control which of 18.09.9 and 19.03.2 is considered "latest" is by munging the underlying tags directly AFAIK :disappointed:

afbjorklund commented 4 years ago

One alternative could be to stop using a constant URL, and to instead parse the GitHub list of releases in JSON ? It would slightly complicate the machine code though.

tianon commented 4 years ago

Indeed, that would be more reliable, but would also increase the chances of running into GitHub's API limits.

afbjorklund commented 4 years ago

Now v19.03.5 is the latest, so it is "fixed" (and the 18.09 is not supported for CE any longer)

Docker Release
~18.09.11~ 2019-11-14 EE only
~18.09.10~ 2019-10-08 EE only
18.09.9 2019-09-03 CE too
18.09.8 2019-07-17 CE too

https://docs.docker.com/engine/release-notes/#version-1809