How to delete all docker images?

In this article let’s discuss about How to delete all docker images?. Let’s go through the following methods without any delay.

Method 1:

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

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar but have a try!

Method 2 :

# List all containers (only IDs)
docker ps -aq
# Stop all running containers
docker stop $(docker ps -aq)
# Remove all containers
docker rm $(docker ps -aq)
# Remove all images
docker rmi $(docker images -q)

Hope the above solution works.

Realted Posts : Maven skip test