Docker: how delete everything

Posted by yingbo on Wed 02 December 2015

Just want fresh restart and delete all containers? Here is the code:

docker stop $(docker ps -a -q) docker rm $(docker ps -a -q)

If you want to delete all images too:
docker stop $(docker ps -a -q) docker rmi $(docker images -a -q)