@VisibleForTesting
    static String resolveDockerHostIpAddress(DockerClient client, URI dockerHost, boolean allowUserOverrides) {
        if (allowUserOverrides) {
            String hostOverride = System.getenv("TESTCONTAINERS_HOST_OVERRIDE");
            if (!StringUtils.isBlank(hostOverride)) {
                return hostOverride;
            }
        }

        switch (dockerHost.getScheme()) {
            case "http":
            case "https":
            case "tcp":
                return dockerHost.getHost();
            case "unix":
            case "npipe":
                if (DockerClientConfigUtils.IN_A_CONTAINER) {
                    return client
                        .inspectNetworkCmd()
                        .withNetworkId("bridge")
                        .exec()
                        .getIpam()
                        .getConfig()
                        .stream()
                        .filter(it -> it.getGateway() != null)
                        .findAny()
                        .map(Network.Ipam.Config::getGateway)
                        .orElseGet(() -> {
                            return DockerClientConfigUtils.getDefaultGateway().orElse("localhost");
                        });
                }
                return "localhost";
            default:
                return null;
        }
    }
Determine the right DockerClientConfig to use for building clients by trial-and-error.

@return a working DockerClientConfig, as determined by successful execution of a ping command
core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java