Skip to content

Commit

Permalink
Fallback to getDefaultGateway() if "bridge" is unavailable. (#2429)
Browse files Browse the repository at this point in the history
Fixes #2239
  • Loading branch information
bsideup committed Mar 25, 2020
1 parent 4f8f8b1 commit d4f894f
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 d4f894f

Please sign in to comment.