machine-drivers/docker-machine-driver-xhyve

Boot2Docker ISO file always downloaded

ggrussenmeyer opened this issue · 0 comments

Symptom

Whenever a new machine is created, the Boot2Docker ISO is downloaded, even the newest one has been cached (cf. docker/machine#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.