docker image prune -a --filter 'until=168h'

Category: Docker

docker image prune -a --filter 'until=168h'

Remove unused images older than a week

Deletes all images not used by any container and last used over 168 hours ago. -a also targets images with tags, not just dangling ones. Destructive: rebuild or re-pull anything removed. Run docker image ls first to review.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.