A
cd ..
DevOps

Docker Cleanup One-Liners

Quick commands to reclaim disk space from unused Docker resources.

2025-08-21
docker, devops, cleanup

The Nuclear Option

Remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes.

docker system prune -a --volumes

Remove stopped containers

docker container prune

Remove dangling images

Images that are not tagged and not used by any container.

docker image prune

Kill all running containers

docker kill $(docker ps -q)

Remove all containers

docker rm $(docker ps -a -q)

Was this useful?

Share with your team

Browse More