Преглед изворни кода

add support for DOCKER_DEFAULT_PLATFORM

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof пре 4 година
родитељ
комит
ba08d39187
1 измењених фајлова са 7 додато и 0 уклоњено
  1. 7 0
      pkg/compose/build.go

+ 7 - 0
pkg/compose/build.go

@@ -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 {