On remote connect failure, docker erronously refers to "docker.example.com" #5604
Description
Description
When trying to connect to a remote host, and the connection fails for whatever reason, it returns the error:
Error pinging Docker server: Cannot connect to the Docker daemon at http://docker.example.com. Is the docker daemon running?
I spent way too much time trying to figure out why docker was trying to connect to docker.example.com instead of my desired host, not realizing someone had just been lazy and chose not to write a proper error message.
Reproduce
- Set DOCKER_HOST to a valid server you can login to but doesn't have docker installed. eg: ssh://user@myserver.local
- Use any docker cli command, or the python library, to interact with docker
Expected behavior
No response
docker version
Client: Docker Engine - Community
Version: 27.3.1
API version: 1.47
Go version: go1.22.7
Git commit: ce12230
Built: Fri Sep 20 11:40:59 2024
OS/Arch: linux/amd64
Context: default
docker info
Client: Docker Engine - Community
Version: 27.3.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.17.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
Additional Info
No response
Activity