2

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?

1 Answers1

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