fix: Cleanup old images, > 3 days
This commit is contained in:
@@ -36,7 +36,7 @@ export default async function () {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
//Cleanup images that are not managed by coolify
|
// Cleanup images that are not managed by coolify
|
||||||
try {
|
try {
|
||||||
await asyncExecShell(
|
await asyncExecShell(
|
||||||
`DOCKER_HOST=${host} docker image prune --filter 'label!=coolify.image=true' -a -f`
|
`DOCKER_HOST=${host} docker image prune --filter 'label!=coolify.image=true' -a -f`
|
||||||
@@ -44,12 +44,12 @@ export default async function () {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
// Cleanup old images >3 days
|
||||||
// Cleanup dangling images
|
|
||||||
try {
|
try {
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker image prune -f`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker image prune --filter "until=72h" -a -f`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user