From 88b3910d804283d988baf2f76c95bcbc5c997102 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 28 Feb 2022 10:12:04 +0100 Subject: [PATCH] fix: Cleanup old images, > 3 days --- src/lib/queues/cleanup.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/queues/cleanup.ts b/src/lib/queues/cleanup.ts index dded603f9..981173a31 100644 --- a/src/lib/queues/cleanup.ts +++ b/src/lib/queues/cleanup.ts @@ -36,7 +36,7 @@ export default async function () { console.log(error); } if (!dev) { - //Cleanup images that are not managed by coolify + // Cleanup images that are not managed by coolify try { await asyncExecShell( `DOCKER_HOST=${host} docker image prune --filter 'label!=coolify.image=true' -a -f` @@ -44,12 +44,12 @@ export default async function () { } catch (error) { console.log(error); } - } - // Cleanup dangling images - try { - await asyncExecShell(`DOCKER_HOST=${host} docker image prune -f`); - } catch (error) { - console.log(error); + // Cleanup old images >3 days + try { + await asyncExecShell(`DOCKER_HOST=${host} docker image prune --filter "until=72h" -a -f`); + } catch (error) { + console.log(error); + } } } }