diff options
author | John Howard <jhoward@microsoft.com> | 2016-10-14 10:14:43 -0700 |
---|---|---|
committer | John Howard <jhoward@microsoft.com> | 2016-10-14 10:42:04 -0700 |
commit | dcd242d8a2e6532d18f17e8a9a6f98edd2ca8bc1 (patch) | |
tree | 334d04f75c3fc9928815258011c3bf3079092e45 /client/request.go | |
parent | 245bd4c3d2594fae3fd5099f29eef528a4c4accd (diff) | |
download | docker-dcd242d8a2e6532d18f17e8a9a6f98edd2ca8bc1.tar.gz |
Windows: Hint to run client elevated
Signed-off-by: John Howard <jhoward@microsoft.com>
Diffstat (limited to 'client/request.go')
-rw-r--r-- | client/request.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/client/request.go b/client/request.go index bfd62bad1e..91a05824e1 100644 --- a/client/request.go +++ b/client/request.go @@ -143,6 +143,20 @@ func (cli *Client) sendClientRequest(ctx context.Context, method, path string, q } } + // Although there's not a strongly typed error for this in go-winio, + // lots of people are using the default configuration for the docker + // daemon on Windows where the daemon is listening on a named pipe + // `//./pipe/docker_engine, and the client must be running elevated. + // Give users a clue rather than the not-overly useful message + // such as `error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/info: + // open //./pipe/docker_engine: The system cannot find the file specified.`. + // Note we can't string compare "The system cannot find the file specified" as + // this is localised - for example in French the error would be + // `open //./pipe/docker_engine: Le fichier spécifié est introuvable.` + if strings.Contains(err.Error(), `open //./pipe/docker_engine`) { + err = errors.New(err.Error() + " In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.") + } + return serverResp, errors.Wrap(err, "error during connect") } |