|
| DockerScheme | scheme () const noexcept |
| const std::string & | path () const noexcept |
| | Socket path (unix) or pipe path (named pipe). Empty for tcp/https.
|
| const std::string & | hostname () const noexcept |
| | Host name (tcp/https). Empty for unix/named pipe.
|
| std::uint16_t | port () const noexcept |
| | TCP port (tcp/https). 0 for unix/named pipe.
|
| std::string | http_host () const |
| | Value to use for the HTTP Host header.
|
| const std::string & | to_string () const noexcept |
| | The original (normalized) URL, for logging/diagnostics.
|
| const std::optional< TlsMaterials > & | tls_materials () const noexcept |
| | TLS materials from the docker context that produced this endpoint (resolve() step 3); nullopt for every other origin, including parse().
|
A resolved Docker daemon endpoint: where and how to reach the daemon.
Resolution order (first hit wins), mirroring testcontainers:
- DOCKER_HOST environment variable.
- docker.host in ~/.testcontainers.properties. In both steps a tcp:// / http:// / scheme-less host upgrades to https when TLS verification is on (DOCKER_TLS_VERIFY, or the docker.tls.verify properties key) — the docker CLI treats such a host as a TLS endpoint, and the default port moves 2375 -> 2376.
- The active Docker context's endpoint: the context name is DOCKER_CONTEXT, else currentContext in ~/.docker/config.json, else "default". A non-"default" name reads Endpoints.docker.Host from ~/.docker/contexts/meta/<sha256(name)>/meta.json. When the context also stores TLS materials (~/.docker/contexts/tls/<sha256(name)>/docker/*.pem), they are attached to the resolved host — see tls_materials() — and a tcp:// endpoint is likewise treated as https; Endpoints.docker.SkipTLSVerify turns server verification off.
- Platform default: Windows named pipe //./pipe/docker_engine; otherwise the rootless sockets $XDG_RUNTIME_DIR/docker.sock then $HOME/.docker/run/docker.sock (if they exist), else the unix socket /var/run/docker.sock.
Steps 2-4 never throw on a malformed/absent file — they fall through to the next step. A malformed DOCKER_HOST (step 1) still throws via parse().