Skip to content

Commit b6a814f

Browse files
committed
Fix docker image ls output
1 parent 8964ce1 commit b6a814f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/scan-images.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ rm -rf image-scan-output
2121
mkdir -p image-scan-output
2222

2323
# Get built container images
24-
docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:$2*" > $1-scanned-container-images.txt
24+
docker image ls \
25+
--filter "reference=ark.stackhpc.com/stackhpc-dev/*:$2*" \
26+
--format "{{.Repository}}:{{.Tag}}" \
27+
> "$1-scanned-container-images.txt"
2528

26-
# Make a file of imagename:tag
27-
images=$(grep --invert-match --no-filename ^REPOSITORY $1-scanned-container-images.txt | sed 's/ \+/:/g' | cut -f 1,2 -d:)
29+
# Read in images file
30+
images=$(cat $1-scanned-container-images.txt)
2831

2932
# Ensure output files exist
3033
touch image-scan-output/clean-images.txt image-scan-output/dirty-images.txt image-scan-output/critical-images.txt

0 commit comments

Comments
 (0)