How to compute in one Bash command line the total memory used by Docker containers running on the local Docker engine?
如何在一个Bash命令行中计算在本地Docker引擎上运行的Docker容器使用的总内存?
1 个解决方案
#1
0
I use the following command to compute the total memory used in MB.
我使用以下命令计算以MB为单位的总内存。
docker stats --no-stream --format 'table {{.MemUsage}}' | sed 's/[A-Za-z]*//g' | awk '{sum += $1} END {print sum "MB"}'