Cleanup coolify image fix

This commit is contained in:
Andras Bacsai 2022-03-02 15:52:06 +01:00
parent 3d27fd04ba
commit ebde77008c
2 changed files with 7 additions and 3 deletions

View File

@ -6,10 +6,14 @@ export default async function () {
const destinationDockers = await prisma.destinationDocker.findMany();
for (const destinationDocker of destinationDockers) {
const host = getEngine(destinationDocker.engine);
// Cleanup old coolify images
try {
await asyncExecShell(
`DOCKER_HOST=${host} docker rmi $(docker images coollabsio/coolify --filter before="coollabsio/coolify:latest" -q)`
const { stdout: images } = await asyncExecShell(
`DOCKER_HOST=${host} docker images coollabsio/coolify --filter before="coollabsio/coolify:latest" -q`
);
if (images) {
await asyncExecShell(`DOCKER_HOST=${host} docker rmi ${images}`);
}
} catch (error) {
console.log(error);
}

View File

@ -87,7 +87,7 @@ const cron = async () => {
await queue.proxy.add('proxy', {}, { repeat: { every: 10000 } });
await queue.ssl.add('ssl', {}, { repeat: { every: 60000 } });
await queue.cleanup.add('cleanup', {}, { repeat: { every: 600000 } });
await queue.cleanup.add('cleanup', {}, { repeat: { every: 300000 } });
await queue.sslRenew.add('sslRenew', {}, { repeat: { every: 1800000 } });
const events = {