mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: fix getContainerIp for Docker > 2.29
parent
0d728f71d0
commit
46050c40b4
|
|
@ -247,9 +247,9 @@ public class LocalDockerManager implements DockerManager {
|
||||||
|
|
||||||
public String getContainerIp(String containerId) {
|
public String getContainerIp(String containerId) {
|
||||||
try {
|
try {
|
||||||
return CommandExecutor.execCommand(5000, "/bin/sh", "-c",
|
return dockerClient.inspectContainerCmd(containerId).exec().getNetworkSettings().getNetworks()
|
||||||
"docker inspect -f \"{{ .NetworkSettings.IPAddress }}\" " + containerId);
|
.get("bridge").getIpAddress();
|
||||||
} catch (IOException | InterruptedException e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue