How to remove old and unused Docker images
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 11:41 PM
When running Docker for a long time, there are a lot of images in the system. How can I remove all unused Docker images at once safely to free up the storage?
In addition, I also want to remove images pulled months ago, So, I'm not asking for removing untagged images only. I'm searching for a way to remove general unused images.
I checked one docker blog online, but still, I was able to get rid of this problem.
Anyone can help!
- Labels:
-
Docker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 01:27 AM
@william smith you can use the prune command to remove the unused docker image.
docker image prune -a --force --filter "until=720h"
This command removes images created more than 30 days (720h) ago.
You need to modify the filter parameter as per your requirement.
Official docker document should help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2022 07:23 AM
Hey there @william smith
Hope everything is going great!
Does @Prabakar Ammeappin's response answer your question? If yes, would you be happy to mark it as best so that other members can find the solution more quickly? Else please let us know if you need more help.
We'd love to hear from you.
Thanks!

