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

Function runAttach

cmd/compose/attach.go:68–86  ·  cmd/compose/attach.go::runAttach
(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts attachOpts)

Source from the content-addressed store, hash-verified

66}
67
68func runAttach(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts attachOpts) error {
69 projectName, err := opts.toProjectName(ctx, dockerCli)
70 if err != nil {
71 return err
72 }
73
74 attachOpts := api.AttachOptions{
75 Service: opts.service,
76 Index: opts.index,
77 DetachKeys: opts.detachKeys,
78 NoStdin: opts.noStdin,
79 Proxy: opts.proxy,
80 }
81 backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...)
82 if err != nil {
83 return err
84 }
85 return backend.Attach(ctx, projectName, attachOpts)
86}

Callers 1

attachCommandFunction · 0.85

Calls 3

NewComposeServiceFunction · 0.92
toProjectNameMethod · 0.80
AttachMethod · 0.65

Tested by

no test coverage detected