dockerHost function
Returns the effective Docker host from the configuration or environment.
Resolution order:
tc.hostkey in~/.testcontainers.propertiesDOCKER_HOSTenvironment variable
The returned string is sanitised: ssh://user@host/ trailing slashes are
removed so that the URI is well-formed.
Returns null when neither source is set.
Implementation
String? dockerHost() {
final host =
testcontainersConfig.tcHost ?? Platform.environment['DOCKER_HOST'];
if (host == null) {
return null;
}
return _sanitizeDockerHost(host);
}