add: pruning
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user