add: pruning

This commit is contained in:
root
2021-09-01 09:06:50 +02:00
parent deb8a35304
commit e0b218f603
+6
View File
@@ -5,10 +5,12 @@ from subprocess import call
from datetime import datetime
from typing import List
KEEP_DAYS = 3
def main():
build_images()
update_containers()
prune()
def build_images():
@@ -37,6 +39,10 @@ def read_file(path: Path) -> List[str]:
return elements
def prune():
hours = int(KEEP_DAYS * 24)
call(['docker', 'system', 'prune', '--all', '--force', '--filter', f'until={hours}h'])
if __name__ == "__main__":
main()