Package org.mandas.docker.client
Class DockerHost
java.lang.Object
org.mandas.docker.client.DockerHost
Represents a dockerd endpoint. A codified DOCKER_HOST.
-
Method Summary
Modifier and TypeMethodDescriptionaddress()Get the Docker ip address or hostname.bindUri()Get the Docker rest bind uri.static Stringstatic Stringstatic Stringstatic Stringstatic intstatic Stringstatic StringGet the path to certificate and key for connecting to Docker via HTTPS.static Stringbooleanstatic DockerHostCreate aDockerHostfrom an explicit address or uri.static DockerHostfromEnv()Create aDockerHostfrom DOCKER_HOST and DOCKER_PORT env vars.inthashCode()host()Get a Docker endpoint usable for instantiating a new DockerHost with DockerHost.from(endpoint).intport()Get the Docker endpoint port.toString()uri()Get the Docker rest uri.
-
Method Details
-
host
Get a Docker endpoint usable for instantiating a new DockerHost with DockerHost.from(endpoint).- Returns:
- A unix socket path or, in the case of a TCP socket, the hostname and port which represents a Docker endpoint.
-
uri
Get the Docker rest uri.- Returns:
- The uri of the Docker endpoint.
-
bindUri
Get the Docker rest bind uri.- Returns:
- The uri of the host for binding ports (or setting $DOCKER_HOST).
-
port
public int port()Get the Docker endpoint port.- Returns:
- The port.
-
address
Get the Docker ip address or hostname.- Returns:
- The ip address or hostname.
-
dockerCertPath
Get the path to certificate and key for connecting to Docker via HTTPS.- Returns:
- The path to the certificate.
-
fromEnv
Create aDockerHostfrom DOCKER_HOST and DOCKER_PORT env vars.- Returns:
- The DockerHost object.
-
from
Create aDockerHostfrom an explicit address or uri.- Parameters:
endpoint- The Docker endpoint.certPath- The certificate path.- Returns:
- The DockerHost object.
-
endpointFromEnv
-
defaultUnixEndpoint
-
defaultWindowsEndpoint
-
defaultAddress
-
defaultPort
public static int defaultPort() -
defaultCertPath
-
certPathFromEnv
-
configPathFromEnv
-
toString
-
equals
-
hashCode
public int hashCode()
-