-
Notifications
You must be signed in to change notification settings - Fork 466
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
Cannot set multi-platform bake contexts if platforms do not match exactly #2486
Comments
Seems like your machine does not support arm architectures which is why your build fails with either |
The issue is not that my machine does not support ARM (I can You can check this locally by changing the platforms for Lines 878 to 881 in 9ad116a
to |
Oh my bad I can't read 🙈 So yes platforms need to perfectly match otherwise it fails with this error because there is no proper linking between platforms in your named context. Does it work with the following definition?: target "default" {
dockerfile-inline = "FROM other"
contexts = {
other = "target:other"
}
platforms = [
"linux/amd64",
"linux/arm64",
"linux/arm/v7"
]
}
target "other" {
dockerfile-inline = "FROM docker.io/library/alpine:3"
platforms = [
"linux/amd64",
"linux/arm64",
"linux/arm/v7"
]
} Maybe if a named context does not match |
Yes, the snippet you link works. The issue is that I want to build two separate targets, one of which supports more platforms than the other 😅 . I think changing Lines 501 to 505 in 9ad116a
to check if |
Yeah maybe a subset would be enough but wonder if should not override with platforms from caller instead per my comment #2486 (comment). WDYT @tonistiigi? |
Contributing guidelines
I've found a bug and checked that ...
Description
When using a
target:
directive as a bakefile context in a multi-platform scenario, the platforms of the targets have to match exactly or the build fails.Expected behaviour
The build should succeed if the referencing target is built for a subset of the platforms of the referenced target.
Actual behaviour
The build fails unless the platforms match exactly.
Buildx version
github.com/docker/buildx v0.14.0
Docker info
Builders list
Configuration
Build logs
Additional info
No response
The text was updated successfully, but these errors were encountered: