Close releases any connections/resources held by the underlying clients. In practice, this service has the same lifetime as the process, so everything will get cleaned up at about the same time regardless even if not invoked.
()
| 224 | // In practice, this service has the same lifetime as the process, so everything |
| 225 | // will get cleaned up at about the same time regardless even if not invoked. |
| 226 | func (s *composeService) Close() error { |
| 227 | var errs []error |
| 228 | if s.dockerCli != nil { |
| 229 | errs = append(errs, s.apiClient().Close()) |
| 230 | } |
| 231 | return errors.Join(errs...) |
| 232 | } |
| 233 | |
| 234 | func (s *composeService) apiClient() client.APIClient { |
| 235 | return s.dockerCli.Client() |