Clear all containers and images in docker

If you want to clear all containers and all images from docker
there is a set of commands you can run to do that .
Note that this will delete the containers and images with no way of recover.

Delete All Containers :

docker rm $(docker ps -a -q)

Delete All images :

docker rmi $(docker images -q)
Posted in Containers Tagged with: , , ,