From 2b312886a1f5b74e89ed1141301f0aa433a541be Mon Sep 17 00:00:00 2001 From: MazziaRick <3341846+MazziaRick@users.noreply.github.com> Date: Sun, 3 Aug 2025 04:21:24 +0200 Subject: [PATCH] Add prune image on update process Remove old docker images unused by containers to avoid disk space saturation. For further information see the discussion : https://github.com/louislam/dockge/discussions/833 --- backend/stack.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/stack.ts b/backend/stack.ts index fbce5002..ed129d64 100644 --- a/backend/stack.ts +++ b/backend/stack.ts @@ -461,6 +461,12 @@ export class Stack { if (exitCode !== 0) { throw new Error("Failed to restart, please check the terminal output for more information."); } + + exitCode = await Terminal.exec(this.server, socket, terminalName, "docker", [ "image", "prune", "--all", "--force" ], this.path); + if (exitCode !== 0) { + throw new Error("Failed to restart, please check the terminal output for more information."); + } + return exitCode; }