docker delete everything code example
Example 1: remove all images docker
docker rmi $(docker images -a -q)
Example 2: docker remove all containers
docker rm $(docker ps -a -q)
Example 3: remove docker volume
docker-compose down
docker rm -f $(docker ps -a -q)
docker volume rm $(docker volume ls -q)
docker-compose up -d
Example 4: docker delete all images
docker system prune
Example 5: delete all containers created x hours ago
docker container prune
Example 6: docker delete container and image
docker container prune --filter "until=4h"
docker image prune --filter "until=4h"