DevOps / Scripts bash Intermediate

Container Resource Usage Reporter

Print CPU and memory usage for all running containers sorted by memory consumption.

bash
#!/bin/bash
docker stats --no-stream --format \
  "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" \
  | sort -k3 -h -r

Prerequisites

  • Docker >= 20

Pro Tips

  • → Add to a cron job and alert if any container exceeds 80%.

Was this module useful?

Share your experience — it helps the team improve.

Leave Feedback

Commercial Licensing

Acquire a production access token or template license for enterprise deployment.

Module Info

Language
bash
Level
Intermediate
Read time
1 min
Published
Jul 2025
License
Commercial License

Newsletter

New modules every week, directly to your inbox.