mirror of
https://github.com/docker/docs.git
synced 2026-04-12 14:25:46 +07:00
This fix tries to fix the issue in #21848 where `docker stats` will not correctly display the container stats in case the container reuse another container's network stack. The issue is that when `stats` is performed, the daemon will check for container network setting's `SandboxID`. Unfortunately, for containers that reuse another container's network stack (`NetworkMode.IsConnected()`), SandboxID is not assigned. Therefore, the daemon thinks the id is invalid and remote API will never return. This fix tries to resolve the SandboxID by iterating through connected containers and identify the appropriate SandboxID. A test case for `stats` remote API has been added to check if `stats` will return within the timeout. This fix fixes #21848. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
9.3 KiB
9.3 KiB