compose icon indicating copy to clipboard operation
compose copied to clipboard

feat: use current buildx builder

Open johanneswuerbach opened this issue 3 years ago • 8 comments

What I did

Use the logic from buildx to select the current builder instance to support using different instances.

This is essentially copying https://github.com/docker/buildx/blob/v0.8.1/commands/build.go#L241 to compose as buildx currently doesn't expose this logic.

I'm not entirely sure how to test those changes (make test is still passing), but I can't see any dedicated buildx tests or a way to test using different builders.

Related issue

Fixes https://github.com/docker/compose/issues/8531

(not mandatory) A picture of a cute animal, if possible in relation with what you did

image

johanneswuerbach avatar May 14 '22 15:05 johanneswuerbach

I wonder if we can ask Buildx maintainers to export this method through an existing API or command. I prefer to avoid code duplication and get benefit from Buildx future releases without having to backport code. WDYT @ndeloof @ulyssessouza @crazy-max @tonistiigi ?

glours avatar May 14 '22 20:05 glours

We copy/pasted code from buildx as compose v2 was not yet an established long term plan for compose but we needed support for build. So it would make perfect sense now we avoid this and use an exported higher level function so we only have to prepare build options, and give buildx a dockercli reference. Just like we did for docker/cli exec and run

ndeloof avatar May 15 '22 06:05 ndeloof

Pushed an update to fix the lint issue.

johanneswuerbach avatar May 17 '22 07:05 johanneswuerbach

Any update here, anything I can do to move this forward?

johanneswuerbach avatar Jun 03 '22 15:06 johanneswuerbach

Rebased, anything else I should be doing here? We would still love to use compose with gha build caching and without this change it makes this fairly complicated.

johanneswuerbach avatar Jun 14 '22 17:06 johanneswuerbach

@ndeloof / @crazy-max any way I could help to move this forward? That would be 🤩

johanneswuerbach avatar Jul 13 '22 18:07 johanneswuerbach

Hi there! Any news?

n-rodriguez avatar Aug 05 '22 02:08 n-rodriguez

^^ seconding that, any news? this would be great to fix!

rory-lamendola avatar Aug 05 '22 18:08 rory-lamendola

+1 I also got bit by this and have the same motivation being discussed in #8531: enabling caching in GitHub Actions.

justinrosenthal avatar Aug 26 '22 08:08 justinrosenthal

Replaced by https://github.com/docker/compose/pull/9729

johanneswuerbach avatar Sep 15 '22 15:09 johanneswuerbach