diff --git a/internal/docker/docker.go b/internal/docker/docker.go index 524d7276..a4504e25 100644 --- a/internal/docker/docker.go +++ b/internal/docker/docker.go @@ -12,11 +12,14 @@ func initClient() (cli *client.Client, err error) { if err != nil { return } - // Optionally ping the server to ensure the connection is valid - _, err = cli.Ping(context.Background()) + // Ping the server to ensure the connection is valid and negotiate API version + ping, err := cli.Ping(context.Background()) if err != nil { return } + // Explicitly negotiate API version based on the ping response + // This ensures the client uses a compatible API version with the Docker daemon + cli.NegotiateAPIVersionPing(ping) return }