Package com.spotify.docker.client
Class DockerHost
java.lang.Object
com.spotify.docker.client.DockerHost
Represents a dockerd endpoint. A codified DOCKER_HOST.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interfaceAn interface to be mocked during testing. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final URIprivate final Stringprivate static final Stringprivate static final intprivate static final Stringprivate static final DockerHost.SystemDelegateprivate final Stringprivate final intprivate static DockerHost.SystemDelegateprivate final URI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddress()Get the Docker ip address or hostname.bindUri()Get the Docker rest bind uri.(package private) static Stringstatic String(package private) static String(package private) static Stringstatic intstatic StringGet the path to certificate and key for connecting to Docker via HTTPS.(package private) 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.(package private) static int(package private) static void(package private) static voidsetSystemDelegate(DockerHost.SystemDelegate delegate) toString()uri()Get the Docker rest uri.
-
Field Details
-
defaultSystemDelegate
-
systemDelegate
-
DEFAULT_UNIX_ENDPOINT
- See Also:
-
DEFAULT_ADDRESS
- See Also:
-
DEFAULT_PORT
private static final int DEFAULT_PORT- See Also:
-
host
-
uri
-
bindUri
-
address
-
port
private final int port -
certPath
-
-
Constructor Details
-
DockerHost
-
-
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.
-
setSystemDelegate
-
restoreSystemDelegate
static void restoreSystemDelegate() -
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.
-
defaultDockerEndpoint
-
endpointFromEnv
-
defaultUnixEndpoint
-
defaultAddress
-
defaultPort
public static int defaultPort() -
portFromEnv
static int portFromEnv() -
defaultCertPath
-
certPathFromEnv
-
toString
-
equals
-
hashCode
public int hashCode()
-