Commit c5556a32 authored by amccaskey's avatar amccaskey
Browse files

Fixing issues with Docker support on Windows.


Signed-off-by: default avataramccaskey <mccaskeyaj@ornl.gov>
parent 28fb5ea4
@echo off
FOR /f "tokens=*" %%i IN ('docker-machine env --shell cmd default') DO %%i
SET DOCKER
\ No newline at end of file
......@@ -72,8 +72,19 @@ public class DockerClientFactory {
// Read them into a Properties object
InputStream processInputStream = process.getInputStream();
Properties dockerSettings = new Properties();
dockerSettings.load(processInputStream);
// Properties.load screws up windows path separators
// so if windows, just get the string from the stream
if (Platform.getOS().equals(Platform.OS_WIN32)) {
String result = streamToString(processInputStream).trim();
String[] dockerEnvs = result.split(System.lineSeparator());
for (String s : dockerEnvs) {
String[] env = s.split("=");
dockerSettings.put(env[0], env[1]);
}
} else {
dockerSettings.load(processInputStream);
}
// Create the Builder object that wil build the DockerClient
Builder builder = new Builder();
......@@ -81,6 +92,8 @@ public class DockerClientFactory {
String endpoint = dockerSettings.getProperty("DOCKER_HOST");
Path dockerCertPath = Paths.get(dockerSettings.getProperty("DOCKER_CERT_PATH"));
System.out.println("DOCKERHOST: " + endpoint);
System.out.println("DOCKER CERT PATH: " + dockerSettings.getProperty("DOCKER_CERT_PATH"));
// Set up the certificates
DockerCertificates certs = DockerCertificates.builder().dockerCertPath(dockerCertPath).build();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment