mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix can't connect message
with socket
This commit is contained in:
parent
92a2b635a3
commit
62b45f0827
1 changed files with 9 additions and 0 deletions
|
@ -1548,6 +1548,9 @@ func (cli *DockerCli) call(method, path string, data interface{}) ([]byte, int,
|
|||
}
|
||||
dial, err := net.Dial(cli.proto, cli.addr)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "connection refused") {
|
||||
return nil, -1, fmt.Errorf("Can't connect to docker daemon. Is 'docker -d' running on this host?")
|
||||
}
|
||||
return nil, -1, err
|
||||
}
|
||||
clientconn := httputil.NewClientConn(dial, nil)
|
||||
|
@ -1588,6 +1591,9 @@ func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer) e
|
|||
}
|
||||
dial, err := net.Dial(cli.proto, cli.addr)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "connection refused") {
|
||||
return fmt.Errorf("Can't connect to docker daemon. Is 'docker -d' running on this host?")
|
||||
}
|
||||
return err
|
||||
}
|
||||
clientconn := httputil.NewClientConn(dial, nil)
|
||||
|
@ -1634,6 +1640,9 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
|
|||
|
||||
dial, err := net.Dial(cli.proto, cli.addr)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "connection refused") {
|
||||
return fmt.Errorf("Can't connect to docker daemon. Is 'docker -d' running on this host?")
|
||||
}
|
||||
return err
|
||||
}
|
||||
clientconn := httputil.NewClientConn(dial, nil)
|
||||
|
|
Loading…
Add table
Reference in a new issue