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
Fail fast on multi platform build with load #582
Conversation
902304f
to
02b8862
Compare
For buildx side, this check should be moved to |
hmm Lines 460 to 462 in 84a734d
|
Ok so it's building before failing if the driver is |
@rumpl Ah, ok. That is different. Add this extra condition to https://github.com/docker/buildx/blob/master/build/build.go#L415 |
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.
^
👍 I'm moving right now, will get at this next week, sorry |
build/build.go
Outdated
@@ -520,6 +520,10 @@ func toSolveOpt(ctx context.Context, d driver.Driver, multiDriver bool, opt Opti | |||
so.FrontendAttrs["platform"] = strings.Join(pp, ",") | |||
} | |||
|
|||
if len(opt.Platforms) != 1 && d.Factory().Name() == "docker-container" { |
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 does not look correct. Multi-platform builds with docker-container
driver are definitely supported. If I understood your description correctly then the condition you want is to check if exporting is happening to docker. Also, we should never check for driver names. There is a features list for that but don't think you need that atm., just check for the exporter.
I should check that the exporter is “docker” right?
Sent from mobile - please excuse tone and brevity
… On Jun 24, 2021, at 19:59, Tõnis Tiigi ***@***.***> wrote:
@tonistiigi requested changes on this pull request.
In build/build.go:
> @@ -520,6 +520,10 @@ func toSolveOpt(ctx context.Context, d driver.Driver, multiDriver bool, opt Opti
so.FrontendAttrs["platform"] = strings.Join(pp, ",")
}
+ if len(opt.Platforms) != 1 && d.Factory().Name() == "docker-container" {
This does not look correct. Multi-platform builds with docker-container driver are definitely supported. If I understood your description correctly then the condition you want is to check if exporting is happening to docker. Also, we should never check for driver names. There is a features list for that but don't think you need that atm., just check for the exporter.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Correct |
43918bf
to
e78215c
Compare
build/build.go
Outdated
@@ -520,6 +520,10 @@ func toSolveOpt(ctx context.Context, d driver.Driver, multiDriver bool, opt Opti | |||
so.FrontendAttrs["platform"] = strings.Join(pp, ",") | |||
} | |||
|
|||
if len(opt.Platforms) > 1 && opt.Exports[0].Type == "docker" { |
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.
Looks correct but move it to line 458 so all the docker exporter handling is in one place.
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
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
Avoid doing a build if we cannot load the images at the end.
This doesn't really fix anything but at least users will see the error right away and not after a potentially long build.