Skip to content

Commit

Permalink
Fallback to getDefaultGateway() if "bridge" is unavailable. (testco…
Browse files Browse the repository at this point in the history
  • Loading branch information
bsideup authored and quincy committed May 28, 2020
1 parent abac19a commit e30df44
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -218,7 +218,9 @@ static String resolveDockerHostIpAddress(DockerClient client, URI dockerHost) {
.filter(it -> it.getGateway() != null)
.findAny()
.map(Network.Ipam.Config::getGateway)
.orElse("localhost");
.orElseGet(() -> {
return DockerClientConfigUtils.getDefaultGateway().orElse("localhost");
});
}
return "localhost";
default:
Expand Down

0 comments on commit e30df44

Please sign in to comment.