use of io.fabric8.docker.client.ConfigBuilder 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;
}
use of io.fabric8.docker.client.ConfigBuilder in project shinyproxy by openanalytics.
the class KubernetesBackend method initialize.
@Override
public void initialize() throws ShinyProxyException {
super.initialize();
ConfigBuilder configBuilder = new ConfigBuilder();
String masterUrl = getProperty(PROPERTY_URL);
if (masterUrl != null)
configBuilder.withMasterUrl(masterUrl);
String certPath = getProperty(PROPERTY_CERT_PATH);
if (certPath != null && Files.isDirectory(Paths.get(certPath))) {
Path certFilePath = Paths.get(certPath, "ca.pem");
if (Files.exists(certFilePath))
configBuilder.withCaCertFile(certFilePath.toString());
certFilePath = Paths.get(certPath, "cert.pem");
if (Files.exists(certFilePath))
configBuilder.withClientCertFile(certFilePath.toString());
certFilePath = Paths.get(certPath, "key.pem");
if (Files.exists(certFilePath))
configBuilder.withClientKeyFile(certFilePath.toString());
}
kubeClient = new DefaultKubernetesClient(configBuilder.build());
}
Aggregations