Skip to content

Commit 265bd9c

Browse files
committed
feat: auto-clear unused build cache
1 parent 3eb57f3 commit 265bd9c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/runner/src/docker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ const runDockerRmi = async (image: DockerImage) => {
3737
console.log(`INFO: Deleting image "${image.tag}"`)
3838
await execa('docker', ['rmi', '--force', image.tag], { stdio: 'inherit' })
3939
console.log(`INFO: Deleted image "${image.tag}"`)
40+
console.log(`INFO: Removing unused build cache`)
41+
await execa('docker', ['builder', 'prune', '--force'], { stdio: 'inherit' })
42+
await execa('docker', ['buildx', 'prune', '--force'], { stdio: 'inherit' })
43+
console.log(`INFO: Removed unused build cache`)
4044
image.status = 'toBuild'
4145
} catch {
4246
console.log(`WARN: Error deleting image "${image.tag}"`)

0 commit comments

Comments
 (0)