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

Function runKill

cli/command/container/kill.go:48–66  ·  view source on GitHub ↗
(ctx context.Context, dockerCLI command.Cli, opts *killOptions)

Source from the content-addressed store, hash-verified

46}
47
48func runKill(ctx context.Context, dockerCLI command.Cli, opts *killOptions) error {
49 apiClient := dockerCLI.Client()
50 errChan := parallelOperation(ctx, opts.containers, func(ctx context.Context, container string) error {
51 _, err := apiClient.ContainerKill(ctx, container, client.ContainerKillOptions{
52 Signal: opts.signal,
53 })
54 return err
55 })
56
57 var errs []error
58 for _, name := range opts.containers {
59 if err := <-errChan; err != nil {
60 errs = append(errs, err)
61 continue
62 }
63 _, _ = fmt.Fprintln(dockerCLI.Out(), name)
64 }
65 return errors.Join(errs...)
66}

Callers 1

newKillCommandFunction · 0.85

Calls 4

parallelOperationFunction · 0.85
ContainerKillMethod · 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…