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

Function startContainersWithoutAttachments

cli/command/container/start.go:201–216  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, containers []string)

Source from the content-addressed store, hash-verified

199}
200
201func startContainersWithoutAttachments(ctx context.Context, dockerCli command.Cli, containers []string) error {
202 var failedContainers []string
203 for _, ctr := range containers {
204 if _, err := dockerCli.Client().ContainerStart(ctx, ctr, client.ContainerStartOptions{}); err != nil {
205 _, _ = fmt.Fprintln(dockerCli.Err(), err)
206 failedContainers = append(failedContainers, ctr)
207 continue
208 }
209 _, _ = fmt.Fprintln(dockerCli.Out(), ctr)
210 }
211
212 if len(failedContainers) > 0 {
213 return fmt.Errorf("failed to start containers: %s", strings.Join(failedContainers, ", "))
214 }
215 return nil
216}

Callers 1

RunStartFunction · 0.85

Calls 4

ContainerStartMethod · 0.80
ClientMethod · 0.65
ErrMethod · 0.65
OutMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…