Skip to content

Commit c0e5aff

Browse files
committed
Use preferred method to get container IP address
This is causing a test in CI to fail. Apply the same fix as in ehrql 2673
1 parent 3d366bf commit c0e5aff

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/docker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def get_mapped_port_for_host(self, name, container_port):
2626

2727
def get_container_ip(self, name):
2828
container = self.get_container(name)
29-
return container.attrs["NetworkSettings"]["IPAddress"]
29+
networks = container.attrs["NetworkSettings"]["Networks"].values()
30+
return list(networks)[0]["IPAddress"]
3031

3132
def run_bg(self, name, image, **kwargs): # pragma: no cover
3233
return self._run(name=name, image=image, detach=True, **kwargs)

0 commit comments

Comments
 (0)