use of io.fabric8.docker.client.DockerClient in project ballerina by ballerina-lang.
the class DefaultBallerinaDockerClient method getDockerClient.
/**
* Creates a {@link DockerClient} from the given Docker host URL.
*
* @param env The URL of the Docker host. If this is null, a {@link DockerClient} pointed to the local Docker
* daemon will be created.
* @return {@link DockerClient} object.
*/
private DockerClient getDockerClient(String env) {
DockerClient client;
if (env == null) {
env = LOCAL_DOCKER_DAEMON_SOCKET;
}
Config dockerClientConfig = new ConfigBuilder().withDockerUrl(env).build();
client = new io.fabric8.docker.client.DefaultDockerClient(dockerClientConfig);
return client;
}
Aggregations