public class DockerHost extends Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static interface |
DockerHost.SystemDelegate
An interface to be mocked during testing.
|
| Modifier and Type | Field and Description |
|---|---|
private String |
address |
private URI |
bindURI |
private String |
certPath |
private static String |
DEFAULT_ADDRESS |
private static int |
DEFAULT_PORT |
private static String |
DEFAULT_UNIX_ENDPOINT |
private String |
host |
private int |
port |
private static DockerHost.SystemDelegate |
systemDelegate |
private URI |
uri |
| Modifier | Constructor and Description |
|---|---|
private |
DockerHost(String endpoint,
String certPath) |
| Modifier and Type | Method and Description |
|---|---|
String |
address()
Get the Docker ip address or hostname.
|
URI |
bindURI()
Get the Docker rest bind uri.
|
(package private) static String |
certPathFromEnv() |
static String |
defaultAddress() |
(package private) static String |
defaultCertPath() |
(package private) static String |
defaultDockerEndpoint() |
static int |
defaultPort() |
static String |
defaultUnixEndpoint() |
String |
dockerCertPath()
Get the path to certificate and key for connecting to Docker via HTTPS.
|
(package private) static String |
endpointFromEnv() |
boolean |
equals(Object o) |
static DockerHost |
from(String endpoint,
String certPath)
Create a
DockerHost from an explicit address or uri. |
static DockerHost |
fromEnv()
Create a
DockerHost from DOCKER_HOST and DOCKER_PORT env vars. |
int |
hashCode() |
String |
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 |
portFromEnv() |
(package private) static void |
setSystemDelegate(DockerHost.SystemDelegate delegate) |
String |
toString() |
URI |
uri()
Get the Docker rest uri.
|
private static DockerHost.SystemDelegate systemDelegate
private static final String DEFAULT_UNIX_ENDPOINT
private static final String DEFAULT_ADDRESS
private static final int DEFAULT_PORT
private final String host
private final URI uri
private final URI bindURI
private final String address
private final int port
private final String certPath
public String host()
public URI uri()
public URI bindURI()
public int port()
public String address()
public String dockerCertPath()
static void setSystemDelegate(DockerHost.SystemDelegate delegate)
public static DockerHost fromEnv()
DockerHost from DOCKER_HOST and DOCKER_PORT env vars.public static DockerHost from(String endpoint, String certPath)
DockerHost from an explicit address or uri.endpoint - The Docker endpoint.certPath - The certificate path.static String defaultDockerEndpoint()
static String endpointFromEnv()
public static String defaultUnixEndpoint()
public static String defaultAddress()
public static int defaultPort()
static int portFromEnv()
static String defaultCertPath()
static String certPathFromEnv()
Copyright © 2016. All rights reserved.