You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a compose file that has a service which specifies platform: and also supplying DOCKER_DEFAULT_PLATFORM
will result in an error. The application appears to be requesting two platforms to be targeted despite the fact that an explicit platform should override (not be combine with) a default one.
I believe this is a BUG introduce by #8848, which provided support for DOCKER_DEFAULT_PLATFORM, but used append to add it to a list of platforms, instead of letting explicit platforms override the default platform.
NOTE: I do not believe this is an issue with buildkit because I'm unable to reproduce the issue with a direct docker build/docker buildx build command. It's only reproducible when using docker compose build. Hopefully I've created this issue in the right place.
Steps to reproduce the issue:
Create these required files in a temporary testing directory:
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose build test
You will see the error below.
Describe the results you received:
multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")
Describe the results you expected: compose should invoke a docker build command that ignores DOCKER_DEFAULT_PLATFORM because, as a "default" value, it is expected to be overridden by an explicitly declared platform.
Additional Details:
My use case is that I have multiple services in my compose config file, one of which requires an explicit platform to be used. The others can be built for any target platform. We use, e.g., DOCKER_DEFAULT_PLATFORM=linux/amd64 to specify the desired target platform for services that support it, while the services with explicit platform: keys are expected to ignore DOCKER_DEFAULT_PLATFORM.
The text was updated successfully, but these errors were encountered:
Description
Using a compose file that has a service which specifies
platform:
and also supplyingDOCKER_DEFAULT_PLATFORM
will result in an error. The application appears to be requesting two platforms to be targeted despite the fact that an explicit platform should override (not be combine with) a default one.
I believe this is a BUG introduce by #8848, which provided support for
DOCKER_DEFAULT_PLATFORM
, but usedappend
to add it to a list of platforms, instead of letting explicit platforms override the default platform.Steps to reproduce the issue:
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose build test
Describe the results you received:
Describe the results you expected:
compose
should invoke adocker build
command that ignoresDOCKER_DEFAULT_PLATFORM
because, as a "default" value, it is expected to be overridden by an explicitly declaredplatform
.Output of
docker compose version
:Output of
docker info
:Additional Details:
My use case is that I have multiple services in my compose config file, one of which requires an explicit platform to be used. The others can be built for any target platform. We use, e.g.,
DOCKER_DEFAULT_PLATFORM=linux/amd64
to specify the desired target platform for services that support it, while the services with explicitplatform:
keys are expected to ignoreDOCKER_DEFAULT_PLATFORM
.The text was updated successfully, but these errors were encountered: