Docker Image Pruning

Docker takes a conservative approach to cleaning up unused objects (often referred to as “garbage collection”), such as images, containers, volumes, and networks. These objects are generally not removed unless you explicitly ask Docker to do so. This can cause Docker to use extra disk space. For each type of object, Docker provides a prune command.

docker.com
docker image prune -f

This will prune (remove trash) only from your docker images, -f switch forces the command not to prompt for input, so it’s convenient to be used in crontab:

0 3 * * 0 docker image prune -f

At 03:00 on Sunday , do the docker image cleanup.

Tested in Debian or Pop OS