Package org.mandas.docker.client.builder
Interface DockerClientBuilder<B extends DockerClientBuilder<B>>
- Type Parameters:
B- the type of the builder
- All Known Implementing Classes:
BaseDockerClientBuilder,JerseyDockerClientBuilder,ResteasyDockerClientBuilder
public interface DockerClientBuilder<B extends DockerClientBuilder<B>>
DockerClientBuilder is an interface which has to be implemented from clients
when they need to use a JAXRS client implementation other than the provided Jersey- Author:
- Dimitris Mandalidis
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionapiVersion(String apiVersion) Set the Docker API version that will be used in the HTTP requests to Docker daemon.build()connectionPoolSize(int connectionPoolSize) Set the size of the connection pool for connections to Docker.connectTimeoutMillis(long connectTimeoutMillis) Set the timeout in milliseconds until a connection to Docker is established.dockerCertificates(DockerCertificatesStore dockerCertificatesStore) Provide certificates to secure the connection to Docker.entityProcessing(DockerClientBuilder.EntityProcessing entityProcessing) Allows setting transfer encoding.fromEnv()Sets or overwritesuri()anddockerCertificates(DockerCertificatesStore)according to the values present in DOCKER_HOST and DOCKER_CERT_PATH environment variables.Adds additional headers to be sent in all requests to the Docker Remote API.readTimeoutMillis(long readTimeoutMillis) Set the SO_TIMEOUT in milliseconds.registryAuthSupplier(RegistryAuthSupplier registryAuthSupplier) uri()useProxy(boolean useProxy) Allows connecting to Docker Daemon using HTTP proxy.
-
Method Details
-
uri
URI uri()- Returns:
- the URI of the Docker engine
-
fromEnv
Sets or overwritesuri()anddockerCertificates(DockerCertificatesStore)according to the values present in DOCKER_HOST and DOCKER_CERT_PATH environment variables.- Returns:
- Modifies a builder that can be used to further customize and then build the client.
- Throws:
DockerCertificateException- if we could not build a DockerCertificates object
-
uri
-
uri
-
build
DefaultDockerClient build() -
header
Adds additional headers to be sent in all requests to the Docker Remote API.- Parameters:
name- the header namevalue- the header value- Returns:
- this
-
registryAuthSupplier
-
connectionPoolSize
Set the size of the connection pool for connections to Docker. Note that due to a known issue, DefaultDockerClient maintains two separate connection pools, each of which is capped at this size. Therefore, the maximum number of concurrent connections to Docker may be up to 2 * connectionPoolSize.- Parameters:
connectionPoolSize- connection pool size- Returns:
- Builder
-
useProxy
Allows connecting to Docker Daemon using HTTP proxy.- Parameters:
useProxy- tells if Docker Client has to connect to docker daemon using HTTP Proxy- Returns:
- Builder
-
apiVersion
Set the Docker API version that will be used in the HTTP requests to Docker daemon.- Parameters:
apiVersion- String for Docker API version- Returns:
- Builder
-
connectTimeoutMillis
Set the timeout in milliseconds until a connection to Docker is established. A timeout value of zero is interpreted as an infinite timeout.- Parameters:
connectTimeoutMillis- connection timeout to Docker daemon in milliseconds- Returns:
- Builder
-
readTimeoutMillis
Set the SO_TIMEOUT in milliseconds. This is the maximum period of inactivity between receiving two consecutive data packets from Docker.- Parameters:
readTimeoutMillis- read timeout to Docker daemon in milliseconds- Returns:
- Builder
-
dockerCertificates
Provide certificates to secure the connection to Docker.- Parameters:
dockerCertificatesStore- DockerCertificatesStore object- Returns:
- Builder
-
entityProcessing
Allows setting transfer encoding. CHUNKED does not send the content-length header while BUFFERED does.By default ApacheConnectorProvider uses CHUNKED mode. Some Docker API end-points seems to fail when no content-length is specified but a body is sent.
- Parameters:
entityProcessing- is the requested entity processing to use when calling docker daemon (tcp protocol).- Returns:
- Builder
-