dockerHost function

String? dockerHost()

Returns the effective Docker host from the configuration or environment.

Resolution order:

  1. tc.host key in ~/.testcontainers.properties
  2. DOCKER_HOST environment 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);
}