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

Function runWait

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

Source from the content-addressed store, hash-verified

40}
41
42func runWait(ctx context.Context, dockerCLI command.Cli, opts *waitOptions) error {
43 apiClient := dockerCLI.Client()
44
45 var errs []error
46 for _, ctr := range opts.containers {
47 res := apiClient.ContainerWait(ctx, ctr, client.ContainerWaitOptions{})
48
49 select {
50 case result := <-res.Result:
51 _, _ = fmt.Fprintln(dockerCLI.Out(), strconv.FormatInt(result.StatusCode, 10))
52 case err := <-res.Error:
53 errs = append(errs, err)
54 }
55 }
56 return errors.Join(errs...)
57}

Callers 1

newWaitCommandFunction · 0.85

Calls 3

ContainerWaitMethod · 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…