|
url = f"http://localhost/containers/{container_id}/stats?stream=false" |
Sometimes, for specific containers, this call hangs and eventually times out.
Using this seems to be working while the code in the link above hangs:
>>> import docker
>>> client = docker.from_env()
>>> container_id = "9484660d83fe7450e6686ed83103644611afaef0378beb021140601d1ce4c7ad"
>>> container = client.containers.get(container_id)
>>> stats = container.stats(stream=False)
Similarly, this does not hang:
docker stats --no-stream 9484660d83fe7450e6686ed83103644611afaef0378beb021140601d1ce4c7ad