add support for DOCKER_DEFAULT_PLATFORM

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2021-10-28 10:28:51 +02:00
parent b2d2c67032
commit ba08d39187
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 7 additions and 0 deletions

View File

@ -261,6 +261,13 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
}))
var plats []specs.Platform
if platform, ok := project.Environment["DOCKER_DEFAULT_PLATFORM"]; ok {
p, err := platforms.Parse(platform)
if err != nil {
return build.Options{}, err
}
plats = append(plats, p)
}
if service.Platform != "" {
p, err := platforms.Parse(service.Platform)
if err != nil {