MCPcopy Create free account
hub / github.com/docker/compose / List

Method List

pkg/compose/ls.go:33–43  ·  view source on GitHub ↗
(ctx context.Context, opts api.ListOptions)

Source from the content-addressed store, hash-verified

31)
32
33func (s *composeService) List(ctx context.Context, opts api.ListOptions) ([]api.Stack, error) {
34 list, err := s.apiClient().ContainerList(ctx, client.ContainerListOptions{
35 Filters: make(client.Filters).Add("label", api.ProjectLabel).Add("label", api.ConfigHashLabel),
36 All: opts.All,
37 })
38 if err != nil {
39 return nil, err
40 }
41
42 return containersToStacks(list.Items)
43}
44
45func containersToStacks(containers []container.Summary) ([]api.Stack, error) {
46 containersByLabel, keys, err := groupContainerByLabel(containers, api.ProjectLabel)

Callers

nothing calls this directly

Calls 4

apiClientMethod · 0.95
containersToStacksFunction · 0.85
ContainerListMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected