Docker: how delete everything

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

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

If you want to delete all images too:

1
2
docker stop $(docker ps -a -q)
docker rmi $(docker images -a -q)

Leave a Comment