소스 검색

Use `DOCKER_DEFAULT_PLATFORM` to determine platform when creating container

Signed-off-by: Laura Brehm <[email protected]>
Laura Brehm 3 년 전
부모
커밋
7bc27d441b
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      pkg/compose/convergence.go

+ 6 - 2
pkg/compose/convergence.go

@@ -479,10 +479,14 @@ func (s *composeService) createMobyContainer(ctx context.Context, project *types
 	if err != nil {
 		return created, err
 	}
+	platform := service.Platform
+	if platform == "" {
+		platform = project.Environment["DOCKER_DEFAULT_PLATFORM"]
+	}
 	var plat *specs.Platform
-	if service.Platform != "" {
+	if platform != "" {
 		var p specs.Platform
-		p, err = platforms.Parse(service.Platform)
+		p, err = platforms.Parse(platform)
 		if err != nil {
 			return created, err
 		}