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

Method stopContainers

pkg/compose/down.go:326–334  ·  pkg/compose/down.go::composeService.stopContainers
(ctx context.Context, serv *types.ServiceConfig, containers []containerType.Summary, timeout *time.Duration, listener api.ContainerEventListener)

Source from the content-addressed store, hash-verified

324}
325
326func (s *composeService) stopContainers(ctx context.Context, serv *types.ServiceConfig, containers []containerType.Summary, timeout *time.Duration, listener api.ContainerEventListener) error {
327 eg, ctx := errgroup.WithContext(ctx)
328 for _, ctr := range containers {
329 eg.Go(func() error {
330 return s.stopContainer(ctx, serv, ctr, timeout, listener)
331 })
332 }
333 return eg.Wait()
334}
335
336func (s *composeService) removeContainers(ctx context.Context, containers []containerType.Summary, service *types.ServiceConfig, timeout *time.Duration, volumes bool) error {
337 eg, ctx := errgroup.WithContext(ctx)

Callers 1

stopMethod · 0.95

Calls 2

stopContainerMethod · 0.95
WaitMethod · 0.65

Tested by

no test coverage detected