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

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours 2022-09-02 15:36:28 +02:00
parent e016faac33
commit 44c55e89c0
1 changed files with 8 additions and 10 deletions

View File

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