Stop all Docker containers
docker stop $(docker ps -a -q)
Remove not running all containers
docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm
Delete all Volume
docker volume rm $(docker volume ls -qf dangling=true)
Delete all containers
docker rm $(docker ps -a -q)
Delete all images
docker rmi $(docker images -q)
Clean docker used space.
sudo service docker stop && sudo rm -rf /var/lib/docker && sudo service docker stop && sudo service docker start
Source:
Comentarios