Merge pull request #8848 from ndeloof/DOCKER_DEFAULT_PLATFORM

add support for DOCKER_DEFAULT_PLATFORM
This commit is contained in:
Ulysses Souza 2021-10-28 12:54:09 +01:00 committed by GitHub
commit 9d04f3ff73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {