Browse Source

always use 'docker' export entry when building with 'up' or 'run' commands

Signed-off-by: Guillaume Lours <[email protected]>
Guillaume Lours 3 years ago
parent
commit
44c55e89c0
1 changed files with 8 additions and 10 deletions
  1. 8 10
      pkg/compose/build.go

+ 8 - 10
pkg/compose/build.go

@@ -168,16 +168,14 @@ func (s *composeService) getBuildOptions(project *types.Project, images map[stri
 			if err != nil {
 				return nil, err
 			}
-			if len(opt.Platforms) > 1 {
-				opt.Exports = []bclient.ExportEntry{{
-					Type: "docker",
-					Attrs: map[string]string{
-						"load": "true",
-					},
-				}}
-				if opt.Platforms, err = useDockerDefaultPlatform(project, service.Build.Platforms); err != nil {
-					opt.Platforms = []specs.Platform{}
-				}
+			opt.Exports = []bclient.ExportEntry{{
+				Type: "docker",
+				Attrs: map[string]string{
+					"load": "true",
+				},
+			}}
+			if opt.Platforms, err = useDockerDefaultPlatform(project, service.Build.Platforms); err != nil {
+				opt.Platforms = []specs.Platform{}
 			}
 			opts[imageName] = opt
 			continue