If you need to remove any old and unused Docker images, then you can do the following:

How to Remove Old and Unused Docker Images

Firstly you need to see all the images:

1
docker images

You can also use ls to see the Docker Images:

1
docker image ls

How to Remove a Single Docker Image

The docker rmi command will remove a single Docker image as follows:

1
docker rmi <image_id>

You can also use the Docker image names as follows:

1
docker rmi ubuntu something

How to Remove Dangling Docker Images

1
docker images -f dangling=true

It’s also possible to prune images as follows:

1
docker image prune

You can also automatically find all the images and remove them directly:

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