All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testcontainers.dockerclient.DockerClientConfigUtils Maven / Gradle / Ivy

There is a newer version: 1.20.1
Show newest version
package org.testcontainers.dockerclient;

import com.github.dockerjava.core.DockerClientConfig;

public class DockerClientConfigUtils {
    public static String getDockerHostIpAddress(DockerClientConfig config) {
        switch (config.getDockerHost().getScheme()) {
        case "http":
        case "https":
        case "tcp":
            return config.getDockerHost().getHost();
        case "unix":
            return "localhost";
        default:
            return null;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy