mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 00:32:34 +01:00
Added check_images
Added check_images which moves the previous $imgList into this function and removed the else as this is handled within the main .sh Signed-off-by: Niall T <jammasterj89@gmail.com>
This commit is contained in:
parent
50bfd11df9
commit
4bb6e19965
1 changed files with 7 additions and 5 deletions
|
@ -1,19 +1,21 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
check_images() {
|
||||||
if [ -n "$imgList" ]; then
|
if [ -n "$imgList" ]; then
|
||||||
pattern=$(echo "$imgList" | sed 's/,/ /g')
|
pattern=$(echo "$imgList" | sed 's/,/ /g')
|
||||||
for img in $pattern; do
|
for img in $pattern; do
|
||||||
echo "Looking for image $img"
|
echo "Looking for image $img"
|
||||||
sha256=$(docker image ls "$img" -q)
|
sha256=$(docker images | grep $img | awk '{print $3}')
|
||||||
if [ -z "$sha256" ]; then
|
if [ -z "$sha256" ]; then
|
||||||
echo "Image $img not found. Exiting."
|
echo "Image $img not found. Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
images="$images $sha256 "
|
images="$sha256"
|
||||||
|
echo "images ------------------------------------ " $images
|
||||||
|
echo "sha356" $sha256
|
||||||
done
|
done
|
||||||
else
|
|
||||||
images=$(docker images -q)
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_4() {
|
check_4() {
|
||||||
logit "\n"
|
logit "\n"
|
||||||
|
|
Loading…
Reference in a new issue