Docker System Commands
These commands give you a big-picture view of Docker - checking disk usage, system info, events, and cleaning up unused resources. They help you monitor, manage, and optimize your Docker environment with ease.
docker → The base command for the Docker CLI
docker system → Manage docker
docker system info → Display system-wide information
docker system df → Show docker disk usage
docker system events → Get real time events from the server
docker system prune → Remove unused data
Docker
docker → The base command for the Docker CLIUsage: docker [OPTIONS] COMMANDDescription:
Docker commands may need sudo. To skip that extra step, an admin can create a docker group and add users to it. Then you can run Docker directly - no sudo required. 🚀
Docker System
docker system → Manage Docker Usage: docker system COMMANDDocker system info
docker system info → Display system-wide information Usage : docker system info [OPTIONS]
Aliases : docker infoDescription:
- This command shows kernel version, containers, and unique images.
- Output can be customized with Go’s text/template.
- Storage driver adds details like pool name, data/metadata files, and space usage.
- Data file stores images, metadata file stores their info.
- On first run, Docker reserves space in
/var/lib/docker.

Docker system df
docker system df → Show docker disk usage Usage : docker system df [OPTIONS]
Aliases : NADescription:
- This command shows how much disk space Docker is using including containers, images, and volumes managed by the Docker daemon.

Docker system events
docker system events → Get real time events from the serverUsage : docker system events [OPTIONS]
Aliases : docker eventsDescription:
- This command streams real-time events from the Docker server.
- Events vary by object type and scope:
- Local scope → visible only on the node where they happen.
- Swarm scope → visible across all managers.
- Shows only the last 256 events.
- Use filters to narrow down what you see.

Docker system prune
docker system prune → Remove unused dataUsage : docker system prune [OPTIONS]
Aliases : NADescription:
This command cleans house: it removes all unused containers, networks, and images (dangling or unused). You can also choose to clear out volumes if you want.
Dangling Docker images are layers that have no tags and are not referenced by any running or stopped containers.

Follow for Engineering and Tech - Tips, Tricks, Roadmaps, Resources, Networking, Motivation, Guidance, and Cool Stuff ♥
