mirror of
https://github.com/docker/compose.git
synced 2025-07-24 14:14:35 +02:00
useDockerDefaultOrServicePlatform fct should return service.platform if defined
and present in the build.platforms list (or if the list is empty) Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
parent
c3e5e49957
commit
10a5d998e6
@ -415,8 +415,8 @@ func useDockerDefaultOrServicePlatform(project *types.Project, service types.Ser
|
||||
return plats, err
|
||||
}
|
||||
|
||||
if service.Platform != "" && !utils.StringContains(service.Build.Platforms, service.Platform) {
|
||||
if len(service.Build.Platforms) > 0 {
|
||||
if service.Platform != "" {
|
||||
if len(service.Build.Platforms) > 0 && !utils.StringContains(service.Build.Platforms, service.Platform) {
|
||||
return nil, fmt.Errorf("service.platform %q should be part of the service.build.platforms: %q", service.Platform, service.Build.Platforms)
|
||||
}
|
||||
// User defined a service platform and no build platforms, so we should keep the one define on the service level
|
||||
|
Loading…
x
Reference in New Issue
Block a user