
9 Docker Commands That Save Hours (But Nobody Teaches You)
Most developers know docker run and docker-compose up . Here are 9 Docker commands that save hours but nobody teaches you. 1. docker system df — See What's Eating Your Disk docker system df TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 47 3 12.4GB 11.2GB (90%) Containers 12 1 2.3GB 2.1GB (91%) Local Volumes 8 2 4.1GB 3.8GB (92%) Build Cache 0 0 0B 0B 90% of your Docker disk usage is reclaimable. You're wasting gigabytes. 2. docker system prune -a — Reclaim Everything docker system prune -a --volumes This removes: All stopped containers All unused networks All unused images (not just dangling) All unused volumes I freed 38GB on my dev machine. Check yours. 3. docker stats — Real-Time Resource Monitor docker stats --format "table {{.Name}} {{.CPUPerc}} {{.MemUsage}}" NAME CPU % MEM USAGE / LIMIT postgres 0.15% 125MiB / 8GiB redis 0.08% 12MiB / 8GiB web-app 2.34% 456MiB / 8GiB Better than htop for finding container memory leaks. 4. docker exec with Environment Variables docker exec -e DEBUG =
Continue reading on Dev.to DevOps
Opens in a new tab




