From 56f303cce73a038be791f1cc5c5e3283710cb2f0 Mon Sep 17 00:00:00 2001 From: ewandor Date: Thu, 21 Sep 2023 17:36:58 +0200 Subject: [PATCH] Pruning all unused docker images --- README.md | 2 ++ main.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 8b3002b..b43f9e0 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Calls portainer's API and updates the images of all currently active stacks ## Usage Update configuration file with your portainer access token and the path of portainer compose directory +After restarting all container, it prunes all unused images + You can then simply execute: python main.py \ No newline at end of file diff --git a/main.py b/main.py index af61b75..930de35 100644 --- a/main.py +++ b/main.py @@ -28,3 +28,5 @@ if __name__ == '__main__': for s in stack_list: if s['Status'] == 1: update_stack(s) + + os.system('docker image prune -f')