use of com.spotify.docker.client.exceptions.DockerCertificateException in project helios by spotify.
the class AgentService method createDockerClient.
private DockerClient createDockerClient(final AgentConfig config) {
final DockerClient dockerClient;
if (isNullOrEmpty(config.getDockerHost().dockerCertPath())) {
dockerClient = new PollingDockerClient(config.getDockerHost().uri());
} else {
final Path dockerCertPath = java.nio.file.Paths.get(config.getDockerHost().dockerCertPath());
final DockerCertificates dockerCertificates;
try {
dockerCertificates = new DockerCertificates(dockerCertPath);
} catch (DockerCertificateException e) {
throw Throwables.propagate(e);
}
dockerClient = new PollingDockerClient(config.getDockerHost().uri(), dockerCertificates);
}
return dockerClient;
}
Aggregations