Skip to content

Commit b5f3d1f

Browse files
committed
remove custom timeout for docker builtin
1 parent ad64103 commit b5f3d1f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

envs/docker.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"bytes"
2424
"context"
2525
"fmt"
26-
"net"
2726
"net/url"
2827
"os"
2928
"path/filepath"
@@ -69,17 +68,7 @@ func (l *Local) RelationshipsFromDocker() Relationships {
6968
return nil
7069
}
7170

72-
opts := [](docker.Opt){docker.FromEnv}
73-
if host := os.Getenv(docker.EnvOverrideHost); host != "" && !strings.HasPrefix(host, "unix://") {
74-
// Setting a dialer on top of a unix socket breaks the connection
75-
// as the client then tries to connect to http:///path/to/socket and
76-
// thus tries to resolve the /path/to/socket host
77-
dialer := &net.Dialer{
78-
Timeout: 2 * time.Second,
79-
}
80-
opts = append(opts, docker.WithDialContext(dialer.DialContext))
81-
}
82-
client, err := docker.NewClientWithOpts(opts...)
71+
client, err := docker.NewClientWithOpts(docker.WithTimeout(2*time.Second), docker.FromEnv)
8372
if err != nil {
8473
if l.Debug {
8574
fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy