Support for build platforms in Compose files
The build.platforms
key has been part of the Compose spec since 2022 but has gone unimplemented in upstream buildx
.
The build.platforms
key allows you to specify the platforms you want to build for in your compose file for a defined service. This is useful when you want to build a multi-platform image for a service defined in your Compose file:
But, with docker buildx bake -f <your-compose-file>
, this will fail to build the image for the specified platforms. This is because docker buildx bake
does not support the build.platforms
key in the Compose file.
We've upgraded our depot bake
command to fix this annoyance and fully support build.platforms
in a Compose file.