-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for docker compose build --push #10148
Conversation
113ba24
to
d2b8da7
Compare
Codecov ReportBase: 72.79% // Head: 73.89% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## v2 #10148 +/- ##
==========================================
+ Coverage 72.79% 73.89% +1.10%
==========================================
Files 2 2
Lines 272 272
==========================================
+ Hits 198 201 +3
+ Misses 62 60 -2
+ Partials 12 11 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but for this option to be introduced, the "classic" builder also need to offer this feature
@ndeloof What do you mean by "classic builder" ? Do you mind sharing more pointers? I'll be glad to update accordingly :) |
in this PR you only updated the options, but the actual build implementation is here: first one uses buildkit (same as |
d2b8da7
to
be779c0
Compare
be779c0
to
4a224a8
Compare
Any news on this? 🤔 |
I did some tests, it works well except for one use case. When you try to build and push an multi-arch image with the legacy builder we got the following error message : ~/sources/compose/pkg/e2e/fixtures/build-test/platforms feat/support_multiarch_push !1 > DOCKER_BUILDKIT=0 docker compose build --push 19:02:19
An image does not exist locally with the tag: gloursdocker/build-test-platform instead of the message saying that the builder doesn't support the multi-arch builds ~/sources/compose/pkg/e2e/fixtures/build-test/platforms feat/support_multiarch_push !1 > DOCKER_BUILDKIT=0 docker compose build 19:02:46
1 error occurred:
* this builder doesn't support multi-arch build, set DOCKER_BUILDKIT=1 to use multi-arch builder |
4a224a8
to
e05e604
Compare
@glours Nice catch indeed! Should be fixed now, do you mind giving it a try again? :) |
Looks good 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: maxcleme <[email protected]>
e05e604
to
634a7d2
Compare
if errs != nil { | ||
return nil | ||
} | ||
if len(o.Exports) != 0 && o.Exports[0].Attrs["push"] == "true" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this really demonstrates we should not use build.Options
as input for classic builder, but that's fine for this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, I'll try to find time to review that
Signed-off-by: maxcleme [email protected]
What I did
Support
docker compose build --push
the same way asdocker buildx build --push
does.Oddly, I was expecting it to be already supported. It occurs to me when dealing with a simple compose file locally using two platforms (
linux/arm64
&linux/amd64
).However when doing
docker compose push
it only pushes the local image (which makes sense since my store can't really store the other). Going through the same asdocker buildx build
does seems logical here.This PR is a bit opportunistic, all feedbacks are welcome 😄
Related issue