Nitrokey / nextbox

NextBox
GNU General Public License v3.0
32 stars 4 forks source link

Periodically purge old docker images #81

Closed blu-nitro closed 7 months ago

blu-nitro commented 7 months ago

Adds a job that periodically removes old docker images that aren't used anymore. It uses the version number to determine the oldest images and removes all but the 3 newest.

Known Issues:

How to test:

  1. Setup Dev environment (https://github.com/Nitrokey/nextbox/blob/master/DEV.md)
  2. SSH on to your NextBox and check if you have more than 3 nextcloud images (docker images)
  3. If not, pull some older versions (docker pull nextcloud:VERSION, eg 25.0.10-apache, 9.0.56-apache)
  4. Change the self.interval in jobs.py -> PurgeOldDockerImagesJob -> _run function to something small like 60 seconds
  5. Check after that time that you have at most 3 images remaining of each type

fixes #70

daringer commented 7 months ago

and please use signed commits