| 418 | } |
| 419 | |
| 420 | func (s *composeService) getBuildxPlugin() (*manager.Plugin, error) { |
| 421 | buildx, err := manager.GetPlugin("buildx", s.dockerCli, &cobra.Command{}) |
| 422 | if err != nil { |
| 423 | return nil, err |
| 424 | } |
| 425 | |
| 426 | if buildx.Err != nil { |
| 427 | return nil, buildx.Err |
| 428 | } |
| 429 | |
| 430 | if buildx.Version == "" { |
| 431 | return nil, fmt.Errorf("failed to get version of buildx") |
| 432 | } |
| 433 | |
| 434 | if versions.LessThan(buildx.Version[1:], buildxMinVersion) { |
| 435 | return nil, fmt.Errorf("compose build requires buildx %s or later", buildxMinVersion) |
| 436 | } |
| 437 | |
| 438 | return buildx, nil |
| 439 | } |
| 440 | |
| 441 | // makeConsole wraps the provided writer to match [containerd.File] interface if it is of type *streams.Out. |
| 442 | // buildkit's NewDisplay doesn't actually require a [io.Reader], it only uses the [containerd.Console] type to |