I know how to remove old Docker images created more that N days ago. See here
But what I'd really like to do is to remove old Docker images that were not used for the last N days.
The goal is to keep images that are frequently used, even if no container is actually using them when I do the cleanup.
Is this possible?
Asked
Active
Viewed 52 times
2
Jean-François Larvoire
- 1,143
- 13
- 13
1 Answers
0
The closest thing I can think of would be docker image prune -a --filter "until=24h", which deletes all unused images created at least 24h ago.
For further reference you can check out the Docker Pruning and Docker System Prune documentation.
Domenico Sibilio
- 1,061
- 1
- 6
- 19
-
This removes images older than one day, which is not what I asked for. – Jean-François Larvoire Feb 11 '21 at 12:59