diff --git a/src/platform.js b/src/platform.js index 96bd79b00..74e34a727 100644 --- a/src/platform.js +++ b/src/platform.js @@ -95,14 +95,7 @@ function emitPlatformReady() { function removeOldImages(callback) { debug('removing old addon images'); - for (var imageName in infra.images) { - const image = infra.images[imageName]; - const tag = image.tag.replace(/:.*@/, '@'); // this remove the semver tag - debug('cleaning up images of %j', image); - // older docker images did not have sha256 and thus have it as - const cmd = `docker images --digests "${image.repo}" | tail -n +2 | awk '{ print $1 ($3=="" ? (":" $2) : ("@" $3)) }' | grep -v "${tag}" | xargs --no-run-if-empty docker rmi`; - shell.execSync('removeOldImagesSync', cmd); - } + shell.execSync('removeOldImagesSync', 'docker image prune --force --all'); callback(); }