Find docker on windows
This commit is contained in:
@@ -3,6 +3,7 @@ package com.petshop.backend;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
@@ -75,6 +76,14 @@ final class DockerComposeSupport {
|
||||
private String resolveDockerExecutable() {
|
||||
String os = System.getProperty("os.name", "").toLowerCase(Locale.ROOT);
|
||||
if (os.contains("win")) {
|
||||
Path dockerPath = Paths.get("C:", "Program Files", "Docker", "Docker", "resources", "bin", "docker.exe");
|
||||
if (Files.isRegularFile(dockerPath)) {
|
||||
return dockerPath.toString();
|
||||
}
|
||||
Path dockerPathAlt = Paths.get("C:", "Program Files", "Docker", "Docker", "resources", "docker.exe");
|
||||
if (Files.isRegularFile(dockerPathAlt)) {
|
||||
return dockerPathAlt.toString();
|
||||
}
|
||||
return "docker.exe";
|
||||
}
|
||||
return "docker";
|
||||
|
||||
Reference in New Issue
Block a user