Low Orbit Flux Logo 2 D

Docker How To Clean Up Images

Eventually, you are going to need to clean up the docker images on your hosts. Things can get messy quick and you will probably have to cross this bridge at some point.

To start out, you can find a listing of all images on your system like this:


docker images -a

Use the following to just delete all images:


docker rmi $(docker images -a -q)

You can delete all dangling images with the following command:


docker images -f dangling=true

You can also use the prune command to clean all dangling images:


docker image prune

Adding the ‘-a’ flag to the prune command to remove any images that aren’t associated with a container:


docker image prune -a

Take a look at our other guide Docker How To Remove Or Delete Images