提交 b59a33ee 编写于 作者: N nicolargo

Docker container monitoring only show half command? #1912

上级 ff4cfcd0
......@@ -249,8 +249,16 @@ class Plugin(GlancesPlugin):
# Container Image
container_stats['Image'] = container.image.tags
# Global stats (from attrs)
# Container Status
container_stats['Status'] = container.attrs['State']['Status']
container_stats['Command'] = container.attrs['Config']['Entrypoint']
# Container Command (see #1912)
container_stats['Command'] = []
if container.attrs['Config'].get('Entrypoint', None):
container_stats['Command'].extend(container.attrs['Config'].get('Entrypoint', []))
if container.attrs['Config'].get('Cmd', None):
container_stats['Command'].extend(container.attrs['Config'].get('Cmd', []))
if container_stats['Command'] == []:
container_stats['Command'] = None
# Standards stats
# See https://docs.docker.com/engine/api/v1.41/#operation/ContainerStats
# Be aware that the API can change... (example see issue #1857)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册