Search in sources :

Example 6 with DockerClient

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;
}
Also used : DockerClient(io.fabric8.docker.client.DockerClient) BallerinaDockerClient(org.ballerinalang.containers.docker.BallerinaDockerClient) Config(io.fabric8.docker.client.Config) ConfigBuilder(io.fabric8.docker.client.ConfigBuilder)

Aggregations

DockerClient (io.fabric8.docker.client.DockerClient)6 Config (io.fabric8.docker.client.Config)3 ConfigBuilder (io.fabric8.docker.client.ConfigBuilder)3 OutputHandle (io.fabric8.docker.dsl.OutputHandle)3 BallerinaDockerClient (org.ballerinalang.containers.docker.BallerinaDockerClient)3 AuthConfig (io.fabric8.docker.api.model.AuthConfig)2 AuthConfigBuilder (io.fabric8.docker.api.model.AuthConfigBuilder)2 DefaultDockerClient (io.fabric8.docker.client.DefaultDockerClient)2 EventListener (io.fabric8.docker.dsl.EventListener)2 Image (io.fabric8.docker.api.model.Image)1 ImageDelete (io.fabric8.docker.api.model.ImageDelete)1