Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ private TransportConfig resolveTransportConfig() throws InvalidConfigurationExce

DockerMachineClient.instance().ensureMachineRunning(machineName);

String dockerDaemonIpAddress = DockerMachineClient.instance().getDockerDaemonIpAddress(machineName);
String dockerDaemonUrl = DockerMachineClient.instance().getDockerDaemonUrl(machineName);

log.info("Docker daemon IP address for docker machine {} is {}", machineName, dockerDaemonIpAddress);
log.info("Docker daemon URL for docker machine {} is {}", machineName, dockerDaemonUrl);

return TransportConfig.builder()
.dockerHost(URI.create("tcp://" + dockerDaemonIpAddress + ":2376"))
.dockerHost(URI.create(dockerDaemonUrl))
.sslConfig(
new LocalDirectorySSLConfig(
Paths.get(System.getProperty("user.home") + "/.docker/machine/certs/").toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,18 @@ public void ensureMachineRunning(@NonNull String machineName) {
}
}

/**
* @deprecated Use getDockerDaemonUrl(@NonNull String machineName) for connection to docker-machine
*/
@Deprecated
public String getDockerDaemonIpAddress(@NonNull String machineName) {
return runShellCommand(executableName, "ip", machineName);
}

public String getDockerDaemonUrl(@NonNull String machineName) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a public class, please make sure that the old method is available (and make it @Deprecated)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return runShellCommand(executableName, "url", machineName);
}

public boolean isMachineRunning(String machineName) {
String status = runShellCommand("docker-machine", "status", machineName);
return status.trim().equalsIgnoreCase("running");
Expand Down