Docker client expects to be closed after usage in long running program

This commit is contained in:
Frederik Ring 2024-02-09 20:55:37 +01:00
parent 7cfea62933
commit 68ba6ce5a1

View File

@ -112,6 +112,12 @@ func newScript(c *Config) (*script, error) {
return nil, fmt.Errorf("newScript: failed to create docker client")
}
s.cli = cli
s.registerHook(hookLevelPlumbing, func(err error) error {
if err := s.cli.Close(); err != nil {
return fmt.Errorf("newScript: failed to close docker client: %w", err)
}
return nil
})
}
logFunc := func(logType storage.LogLevel, context string, msg string, params ...any) {