(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts buildOptions, services []string)
| 150 | } |
| 151 | |
| 152 | func runBuild(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts buildOptions, services []string) error { |
| 153 | if opts.print { |
| 154 | backendOptions.Add(compose.WithEventProcessor(display.Quiet())) |
| 155 | } |
| 156 | backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...) |
| 157 | if err != nil { |
| 158 | return err |
| 159 | } |
| 160 | |
| 161 | opts.All = true // do not drop resources as build may involve some dependencies by additional_contexts |
| 162 | project, _, err := opts.ToProject(ctx, dockerCli, backend, nil, cli.WithoutEnvironmentResolution) |
| 163 | if err != nil { |
| 164 | return err |
| 165 | } |
| 166 | |
| 167 | if err := applyPlatforms(project, false); err != nil { |
| 168 | return err |
| 169 | } |
| 170 | |
| 171 | apiBuildOptions, err := opts.toAPIBuildOptions(services) |
| 172 | if err != nil { |
| 173 | return err |
| 174 | } |
| 175 | apiBuildOptions.Attestations = true |
| 176 | |
| 177 | return backend.Build(ctx, project, apiBuildOptions) |
| 178 | } |
no test coverage detected