Skip to content

DOCKER_HOST without unix:// prefix prints a confusing error: Cannot connect to the Docker daemon at tcp://localhost:2375/foo.sock. #5846

Open
@AkihiroSuda

Description

@AkihiroSuda

Description

$ DOCKER_HOST=/invalid.sock docker version
Client:
 Version:           27.5.1
 API version:       1.47
 Go version:        go1.22.11
 Git commit:        9f9e405
 Built:             Wed Jan 22 13:39:08 2025
 OS/Arch:           linux/arm64
 Context:           default
Cannot connect to the Docker daemon at tcp://localhost:2375/invalid.sock. Is the docker daemon running?

This error message is quite confusing, as the original invalid DOCKER_HOST value does not contain tcp://localhost:2375.
Probably it should return an error like invalid $DOCKER_HOST value "/invalid.sock": must start with "unix://" or "tcp://"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions