Open ciaranmcnulty opened 3 years ago
I think this should be an and only
My recommendation is that if compose wants to define platform(s) to build it should add a new field under the build block and make it into an array. Runtime platform != build platform(s).
Thank you for sharing this feedback @ciaranmcnulty 👍 As @tonistiigi points out, runtime platform can be a subset of build platforms. For example, you may be building for arm
and amd64
but only running only one of them at a time (arm
locally and amd64
on Cloud).
That being said, it makes sense to me that the implementations would pick the runtime platform as the build platform if one is explicitly specified. Otherwise, platform
attribute becomes severely lacking, as Compose implementations would build on native platform but attempt to run immediately after on the specified one.
What are your thoughts @ndeloof @hangyan @justincormack @ulyssessouza?
I agree build platform should be by default == runtime platform, but we should introduce a new platform attribute on build section to cover multi-platform builds, which would be very useful for build and push scenarios.
The linguistic thing is whether the current wording reflects the current intention.
I'd suggest changing it to AND if the intention was for the flag to be used for both build (in a build platform) and run (in a run platform).
My personal issue is that the build platform I'm using is bake
but the runner is compose
and the mis-match is confusing.
I'm fully behind a build.platforms
key in future, reflecting how bake
has implemented build.x-bake.platforms
👍
I didn't know about the x-bake
extension(s).
@tonistiigi could you please make a formal proposal for this on the spec? Extensions are a nice way to experiment things on compose-related tooling, but the final goal is to serve as "proof of concept" before those get adopted in the spec.
Seems like there's a broad agreement on this 🎉 For the short-term, it makes sense to me that we replace and/or
with and
in the spec for clarity.
The platform field definition contains the following
This use of
and/or
implies it's ok for a definition to use the platform for building only, or running only. I think this should be anand
only