Useful Docker Commands

To see memory and CPU usage for all containers:
docker stats

b. To see disk usage for all containers:
docker ps -s

c. To see memory usage for all containers:
docker stats –no-stream –format “{{.Name}}: {{.MemUsage}}”

d. To see which container has been hit by the OOM killer:
for each in $(docker ps –format “{{.Names}}”); do if docker inspect –format ‘{{.State.OOMKilled}}’ $each | grep -q ‘true’; then echo “$each is OOMKilled”; fi; done

About vicki

Welcome to the Sovereign Republic of Vickistan. I am the President here. Lucky me! No taxes or laws yet. Lucky you!
This entry was posted in Linux. Bookmark the permalink.