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

Function runDown

cmd/compose/down.go:81–104  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts downOptions, services []string)

Source from the content-addressed store, hash-verified

79}
80
81func runDown(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts downOptions, services []string) error {
82 project, name, err := opts.projectOrName(ctx, dockerCli, services...)
83 if err != nil {
84 return err
85 }
86
87 var timeout *time.Duration
88 if opts.timeChanged {
89 timeoutValue := time.Duration(opts.timeout) * time.Second
90 timeout = &timeoutValue
91 }
92 backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...)
93 if err != nil {
94 return err
95 }
96 return backend.Down(ctx, name, api.DownOptions{
97 RemoveOrphans: opts.removeOrphans,
98 Project: project,
99 Timeout: timeout,
100 Images: opts.images,
101 Volumes: opts.volumes,
102 Services: services,
103 })
104}

Callers 1

downCommandFunction · 0.85

Calls 3

NewComposeServiceFunction · 0.92
projectOrNameMethod · 0.80
DownMethod · 0.65

Tested by

no test coverage detected