Show memory usage of all docker / lxc containers


http://www.commandlinefu.com/commands/view/13708/show-memory-usage-of-all-docker-lxc-containers


docker

CONTAINER


for line in `docker ps | awk '{print $1}' | grep -v CONTAINER`; do docker ps | grep $line | awk '{printf $NF" "}' && echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024 ))MB ; done

posted @ 2017-02-25 09:09  张同光  阅读(98)  评论(0编辑  收藏  举报