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 interface
An interface to be mocked during testing. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final URI
private final String
private static final String
private static final int
private static final String
private static final DockerHost.SystemDelegate
private final String
private final int
private static DockerHost.SystemDelegate
private 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 String
static String
(package private) static String
(package private) static String
static int
static String
Get the path to certificate and key for connecting to Docker via HTTPS.(package private) static String
boolean
static DockerHost
Create aDockerHost
from an explicit address or uri.static DockerHost
fromEnv()
Create aDockerHost
from DOCKER_HOST and DOCKER_PORT env vars.int
hashCode()
host()
Get a Docker endpoint usable for instantiating a new DockerHost with DockerHost.from(endpoint).int
port()
Get the Docker endpoint port.(package private) static int
(package private) static void
(package private) static void
setSystemDelegate
(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 aDockerHost
from DOCKER_HOST and DOCKER_PORT env vars.- Returns:
- The DockerHost object.
-
from
Create aDockerHost
from 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()
-