Package org.testcontainers.dockerclient
Class DockerClientProviderStrategy
java.lang.Object
org.testcontainers.dockerclient.DockerClientProviderStrategy
- Direct Known Subclasses:
DockerDesktopClientProviderStrategy,DockerMachineClientProviderStrategy,EnvironmentAndSystemPropertyClientProviderStrategy,NpipeSocketClientProviderStrategy,RootlessDockerClientProviderStrategy,TestcontainersHostPropertyClientProviderStrategy,UnixSocketClientProviderStrategy
Mechanism to find a viable Docker client configuration according to the host system environment.
The order is:
TestcontainersHostPropertyClientProviderStrategyEnvironmentAndSystemPropertyClientProviderStrategy- Persistable
DockerClientProviderStrategyin~/.testcontainers.properties - Other strategies order by priority
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancom.github.dockerjava.api.DockerClientDeprecated.static com.github.dockerjava.api.DockerClientgetClientForConfig(TransportConfig transportConfig) abstract Stringcom.github.dockerjava.api.DockerClientstatic DockerClientProviderStrategygetFirstValidStrategy(List<DockerClientProviderStrategy> strategies) Determine the right DockerClientConfig to use for building clients by trial-and-error.com.github.dockerjava.api.model.InfogetInfo()protected int/* @return the path under which the Docker unix socket is reachable relative to the Docker daemonabstract TransportConfigprotected booleanprotected booleanprotected booleantest()TODO we should consider moving this to docker-java at some point
-
Constructor Details
-
DockerClientProviderStrategy
public DockerClientProviderStrategy()
-
-
Method Details
-
getDescription
- Returns:
- a short textual description of the strategy
-
isApplicable
protected boolean isApplicable() -
isPersistable
protected boolean isPersistable() -
allowUserOverrides
public boolean allowUserOverrides() -
getRemoteDockerUnixSocketPath
/* @return the path under which the Docker unix socket is reachable relative to the Docker daemon -
getPriority
protected int getPriority()- Returns:
- highest to lowest priority value
-
getTransportConfig
- Throws:
InvalidConfigurationException- if this strategy fails
-
getClient
Deprecated.- Returns:
- a usable, tested, Docker client configuration for the host system environment
-
test
TODO we should consider moving this to docker-java at some point -
getFirstValidStrategy
public static DockerClientProviderStrategy getFirstValidStrategy(List<DockerClientProviderStrategy> strategies) Determine the right DockerClientConfig to use for building clients by trial-and-error.- Returns:
- a working DockerClientConfig, as determined by successful execution of a ping command
-
getClientForConfig
public static com.github.dockerjava.api.DockerClient getClientForConfig(TransportConfig transportConfig) -
getDockerHostIpAddress
-
getDockerClient
public com.github.dockerjava.api.DockerClient getDockerClient() -
getInfo
public com.github.dockerjava.api.model.Info getInfo()
-
getDockerClient()