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

Method Attach

pkg/compose/attach_service.go:28–45  ·  pkg/compose/attach_service.go::composeService.Attach
(ctx context.Context, projectName string, options api.AttachOptions)

Source from the content-addressed store, hash-verified

26)
27
28func (s *composeService) Attach(ctx context.Context, projectName string, options api.AttachOptions) error {
29 projectName = strings.ToLower(projectName)
30 target, err := s.getSpecifiedContainer(ctx, projectName, oneOffInclude, false, options.Service, options.Index)
31 if err != nil {
32 return err
33 }
34
35 detachKeys := options.DetachKeys
36 if detachKeys == "" {
37 detachKeys = s.configFile().DetachKeys
38 }
39
40 var attach container.AttachOptions
41 attach.DetachKeys = detachKeys
42 attach.NoStdin = options.NoStdin
43 attach.Proxy = options.Proxy
44 return container.RunAttach(ctx, s.dockerCli, target.ID, &attach)
45}

Callers

nothing calls this directly

Calls 2

getSpecifiedContainerMethod · 0.95
configFileMethod · 0.95

Tested by

no test coverage detected