machine-drivers / docker-machine-driver-xhyve

docker-machine/minikube/minishift driver plugin for xhyve/hyperkit (native macOS hypervisor.framework)
https://godoc.org/github.com/machine-drivers/docker-machine-driver-xhyve
BSD 3-Clause "New" or "Revised" License
888 stars 74 forks source link

Boot2Docker ISO file always downloaded #197

Open ggrussenmeyer opened 6 years ago

ggrussenmeyer commented 6 years ago

Symptom

Whenever a new machine is created, the Boot2Docker ISO is downloaded, even the newest one has been cached (cf. https://github.com/docker/machine/issues/4058).

Root cause

Only the 3 digits of the version number are considered when extracted from the ISO: https://github.com/zchee/docker-machine-driver-xhyve/blob/a2060c0729fc92f98265d85bdaed6dd88562bf15/b2d/b2d.go#L219 while the actual (and encoded) version number may be suffixed (e.g. with "-ce" in v17.07.0-ce ISO file version). Thus for the v17.07.0-ce ISO file, the version is parsed as 17.07.0 while the advertised one (in https://api.github.com/repos/boot2docker/boot2docker/releases/latest) is 17.07.0-ce, hence a mismatch and hence a download.

It is weird that the docker-machine source code implementation for that extraction, which differs, is broken as well.