Docker Clear Containers And Images

Docker
docker image prune -a

深度清理

docker system prune -a

Delete all containers

docker rm $(docker ps -a -q)

Delete all images

docker rmi $(docker images -q)
docker rmi -f $(docker images -q)

Other command

docker container ls -a

docker rm -v $(docker images --filter "dangling=true" -q --no-trunc)


docker rmi $(docker images --filter "dangling=true" -q --no-trunc)