15 docker client #2
@@ -23,8 +23,15 @@ public class DockerConfig {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public DockerClient dockerClient() {
|
public DockerClient dockerClient() {
|
||||||
|
|
||||||
|
// Если переменная подтянулась криво, возвращаем её к сокету
|
||||||
|
String hostToUse = dockerHost;
|
||||||
|
if (hostToUse.contains("2375")) {
|
||||||
|
hostToUse = "unix:///var/run/docker.sock";
|
||||||
|
}
|
||||||
|
|
||||||
DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()
|
DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()
|
||||||
.withDockerHost(dockerHost)
|
.withDockerHost(hostToUse)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
DockerHttpClient httpClient = new ApacheDockerHttpClient.Builder()
|
DockerHttpClient httpClient = new ApacheDockerHttpClient.Builder()
|
||||||
@@ -32,8 +39,8 @@ public class DockerConfig {
|
|||||||
.sslConfig(config.getSSLConfig())
|
.sslConfig(config.getSSLConfig())
|
||||||
.maxConnections(100)
|
.maxConnections(100)
|
||||||
.build();
|
.build();
|
||||||
_logger.info("DOCKER_HOST:{}",config.getDockerHost());
|
|
||||||
|
|
||||||
|
_logger.info("Final Docker Host used: {}", config.getDockerHost());
|
||||||
return DockerClientImpl.getInstance(config, httpClient);
|
return DockerClientImpl.getInstance(config, httpClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user