Skip to content

Commit 20dfd7a

Browse files
committed
Fix docker image ls output
1 parent 78b7409 commit 20dfd7a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/scan-images.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ file_prep() {
4545

4646
# Gather image lists
4747
get_images() {
48-
docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:$2*" > $1-scanned-container-images.txt
49-
grep --invert-match --no-filename ^REPOSITORY $1-scanned-container-images.txt | sed 's/ \+/:/g' | cut -f 1,2 -d:
48+
local output_file="$1-scanned-container-images.txt"
49+
50+
docker image ls \
51+
--filter "reference=ark.stackhpc.com/stackhpc-dev/*:$2*" \
52+
--format "{{.Repository}}:{{.Tag}}" \
53+
> "$output_file"
54+
55+
cat "$output_file"
5056
}
5157

5258
# Generate ignored vulnerabilities file

0 commit comments

Comments
 (0)