MCPcopy Index your code
hub / github.com/docker/cli / runPause

Function runPause

cli/command/container/pause.go:42–58  ·  view source on GitHub ↗
(ctx context.Context, dockerCLI command.Cli, opts *pauseOptions)

Source from the content-addressed store, hash-verified

40}
41
42func runPause(ctx context.Context, dockerCLI command.Cli, opts *pauseOptions) error {
43 apiClient := dockerCLI.Client()
44 errChan := parallelOperation(ctx, opts.containers, func(ctx context.Context, container string) error {
45 _, err := apiClient.ContainerPause(ctx, container, client.ContainerPauseOptions{})
46 return err
47 })
48
49 var errs []error
50 for _, ctr := range opts.containers {
51 if err := <-errChan; err != nil {
52 errs = append(errs, err)
53 continue
54 }
55 _, _ = fmt.Fprintln(dockerCLI.Out(), ctr)
56 }
57 return errors.Join(errs...)
58}

Callers 1

newPauseCommandFunction · 0.85

Calls 4

parallelOperationFunction · 0.85
ContainerPauseMethod · 0.80
ClientMethod · 0.65
OutMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…