Is there any way to display container names in docker stats?

后端 未结 4 585
滥情空心
滥情空心 2021-01-31 14:27

I want to display state of all running container, so I could achieve it like the following:

docker stats $(docker ps -q)

CON         


        
4条回答
  •  轮回少年
    2021-01-31 15:27

    Since docker 1.13.0 (#27797), there's a format option which support container name. So you can run it like this:

    docker stats --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}"
    

    See Docker Formatting for full details.

提交回复
热议问题