Skip to content

Commit c2461c2

Browse files
committed
filter
1 parent 58b4c7e commit c2461c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ImageDetector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class ImageDetector {
1010

1111
async getExistingImages(): Promise<string[]> {
1212
const ids = (await exec.exec(`docker image ls -q`, [], { silent: true })).stdoutStr.split(`\n`).filter(id => id !== ``)
13-
const repotags = (await exec.exec(`sh -c "docker image ls --all --format '{{ .Repository }}:{{ .Tag }}'"`, [], { silent: true })).stdoutStr.split(`\n`).filter(id => id !== `` || !id.includes(`<none>`));
13+
const repotags = (await exec.exec(`sh -c "docker image ls --format '{{ .Repository }}:{{ .Tag }}' --filter 'dangling=false'"`, [], { silent: true })).stdoutStr.split(`\n`).filter(id => id !== ``);
1414
([...ids, ...repotags]).forEach(image => this.existingImages.add(image))
1515
core.debug(JSON.stringify({ existingImages: this.existingImages }))
1616
return Array.from(this.existingImages)

0 commit comments

Comments
 (0)