How do you remove all Docker containers, images and volumes safely in a dev environment?
BeginnerProductionOperations, Rootless & Podman
Answer
docker rm -f $(docker ps -aq)
docker system prune -a --volumes
The second command removes every unused image and volume, which is destructive; run docker system df first and never do it on a production host. Prefer filters like --filter until=24h or label!=keep.
More on Operations, Rootless & Podman
How do you set up rootless Docker on Ubuntu?IntermediateHow do rootless containers handle privileged ports and networking?AdvancedWhat is Podman Quadlet?AdvancedCan Podman run Docker Compose files?IntermediateWhat is a Podman pod?IntermediateHow do you update a single Compose service without touching others?Beginner