Skip to content

Commit

Permalink
v1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
naku committed Nov 26, 2024
1 parent a8237af commit 20f7b58
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/helpers/docker/DockerUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.spotify.docker.client.DockerClient;
import com.spotify.docker.client.auth.FixedRegistryAuthSupplier;
import com.spotify.docker.client.messages.RegistryAuth;
import play.Logger;
import play.Play;

import java.net.URI;
Expand All @@ -26,17 +27,22 @@ public static DockerClient createDockerClient() {
try {
DefaultDockerClient.Builder builder = DefaultDockerClient.builder();
if (isUseSocket()) {
builder.uri(URI.create("unix:///var/run/docker.sock"));
String socketUri = "unix:///var/run/docker.sock";
Logger.info("Using docker socket: " + socketUri);
builder.uri(URI.create(socketUri));
} else {
if (getDockerCertDir() != null) {
Logger.info("Using docker certificate directory: " + getDockerCertDir());
builder
.uri(URI.create("https://" + getDockerRemoteHost() + ":" + getDockerRemotePort("2376")))
.dockerCertificates(DockerCertificates.builder()
.dockerCertPath(Paths.get(getDockerCertDir()))
.build().orNull());
} else {
Logger.info("Using docker without certificates");
builder.uri(URI.create("http://" + getDockerRemoteHost() + ":" + getDockerRemotePort("2400")));
if (getDockerAuthorization() != null) {
Logger.info("Using docker with basic authorization");
builder.header("Authorization", "Basic " + getDockerAuthorization());
}
}
Expand Down

0 comments on commit 20f7b58

Please sign in to comment.