docker-archive / compose-cli

Easily run your Compose application to the cloud with compose-cli
Apache License 2.0
955 stars 253 forks source link

build metrics compatibility for next 22.06 #2151

Closed crazy-max closed 2 years ago

crazy-max commented 2 years ago

follow-up https://github.com/docker/cli/pull/3314 and https://github.com/docker/compose-cli/pull/2104

Ensures build metrics are future proof for the next Docker major release.

To detect if buildx will be used while typing docker build ..., we need to check the current docker cli version. I don't think there is another simple way, besides creating an infamous custom dimension in Looker. :sweat_smile:

cc @tonistiigi @chris-crone @gtardif @mat007

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

crazy-max commented 2 years ago

converting to draft for now. after discussing with @tonistiigi, calling docker version to retrieve cli version for build metadata adds more overhead (~80ms). will take a look at a better alternative.

crazy-max commented 2 years ago

Switch from shelling out to retrieve docker cli version by using the debug/buildinfo module. Atm docker cli strips DWARF symbol table so will be empty for cli < 22.06 but will be solved by https://github.com/docker/cli/pull/3717.

PTAL @mat007 @rumpl @glours