MCPcopy
hub / github.com/docker/compose / runProfiles

Function runProfiles

cmd/compose/config.go:476–502  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string)

Source from the content-addressed store, hash-verified

474}
475
476func runProfiles(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string) error {
477 set := map[string]struct{}{}
478
479 backend, err := compose.NewComposeService(dockerCli)
480 if err != nil {
481 return err
482 }
483
484 project, err := opts.ToProject(ctx, dockerCli, backend, services)
485 if err != nil {
486 return err
487 }
488 for _, s := range project.AllServices() {
489 for _, p := range s.Profiles {
490 set[p] = struct{}{}
491 }
492 }
493 profiles := make([]string, 0, len(set))
494 for p := range set {
495 profiles = append(profiles, p)
496 }
497 sort.Strings(profiles)
498 for _, p := range profiles {
499 _, _ = fmt.Fprintln(dockerCli.Out(), p)
500 }
501 return nil
502}
503
504func runConfigImages(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string) error {
505 backend, err := compose.NewComposeService(dockerCli)

Callers 1

configCommandFunction · 0.85

Calls 3

NewComposeServiceFunction · 0.92
ToProjectMethod · 0.45
OutMethod · 0.45

Tested by

no test coverage detected