From 44c55e89c072b603933db296b8ee5f87ac343918 Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Fri, 2 Sep 2022 15:36:28 +0200 Subject: [PATCH] always use 'docker' export entry when building with 'up' or 'run' commands Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> --- pkg/compose/build.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pkg/compose/build.go b/pkg/compose/build.go index 2583039c1..6079d853d 100644 --- a/pkg/compose/build.go +++ b/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