adjast wss + docker logs
ZerodepDockerHttpClient
This commit is contained in:
+2
-2
@@ -35,8 +35,8 @@ dependencies {
|
|||||||
implementation 'com.github.docker-java:docker-java-api:3.3.6'
|
implementation 'com.github.docker-java:docker-java-api:3.3.6'
|
||||||
implementation 'com.github.docker-java:docker-java-core:3.3.6'
|
implementation 'com.github.docker-java:docker-java-core:3.3.6'
|
||||||
|
|
||||||
// Транспорт (HTTP Client 5) — именно он нужен для DockerConfig.java
|
// Тот самый транспорт, который решит проблему с unix-сокетом
|
||||||
implementation 'com.github.docker-java:docker-java-transport-httpclient5:3.3.6'
|
implementation 'com.github.docker-java:docker-java-transport-zerodep:3.4.0'
|
||||||
|
|
||||||
// Spring Boot Starter для STOMP WebSockets
|
// Spring Boot Starter для STOMP WebSockets
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-websocket'
|
implementation 'org.springframework.boot:spring-boot-starter-websocket'
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import com.github.dockerjava.api.DockerClient;
|
|||||||
import com.github.dockerjava.core.DefaultDockerClientConfig;
|
import com.github.dockerjava.core.DefaultDockerClientConfig;
|
||||||
import com.github.dockerjava.core.DockerClientConfig;
|
import com.github.dockerjava.core.DockerClientConfig;
|
||||||
import com.github.dockerjava.core.DockerClientImpl;
|
import com.github.dockerjava.core.DockerClientImpl;
|
||||||
import com.github.dockerjava.httpclient5.ApacheDockerHttpClient;
|
|
||||||
import com.github.dockerjava.transport.DockerHttpClient;
|
import com.github.dockerjava.transport.DockerHttpClient;
|
||||||
|
import com.github.dockerjava.zerodep.ZerodepDockerHttpClient;
|
||||||
import com.jambotronGroup.jambotron.controllers.FileBrowserTreeController;
|
import com.jambotronGroup.jambotron.controllers.FileBrowserTreeController;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -13,6 +14,8 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class DockerConfig {
|
public class DockerConfig {
|
||||||
|
|
||||||
@@ -35,14 +38,9 @@ public class DockerConfig {
|
|||||||
.withDockerHost(hostPath)
|
.withDockerHost(hostPath)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// 2. ГЛАВНОЕ ИЗМЕНЕНИЕ:
|
// Zerodep напрямую работает с сокетом и не переключается на 2375
|
||||||
// Мы передаем URI напрямую в Builder транспорта Apache.
|
DockerHttpClient httpClient = new ZerodepDockerHttpClient.Builder()
|
||||||
// Это "вырывает" логику переключения у библиотеки docker-java,
|
.dockerHost(URI.create(dockerHost))
|
||||||
// так как транспорт теперь знает только об этом конкретном URI.
|
|
||||||
DockerHttpClient httpClient = new ApacheDockerHttpClient.Builder()
|
|
||||||
.dockerHost(dockerUri)
|
|
||||||
.sslConfig(config.getSSLConfig())
|
|
||||||
.maxConnections(100)
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
_logger.info("FINAL ARCHITECTURE: Transport locked to {}", dockerUri);
|
_logger.info("FINAL ARCHITECTURE: Transport locked to {}", dockerUri);
|
||||||
|
|||||||
Reference in New Issue
Block a user