mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-18 16:22:33 +01:00
Reorder of sed command on images
Ensure sed command is first when filtering on images to ensure the description row is removed correctly. Signed-off-by: Niall T <jammasterj89@gmail.com>
This commit is contained in:
parent
c2caa29512
commit
d2963b4c42
1 changed files with 2 additions and 2 deletions
|
@ -114,11 +114,11 @@ main () {
|
||||||
if [ -n "$include" ]; then
|
if [ -n "$include" ]; then
|
||||||
pattern=$(echo "$include" | sed 's/,/|/g')
|
pattern=$(echo "$include" | sed 's/,/|/g')
|
||||||
containers=$(docker ps | sed '1d' | awk '{print $NF}' | grep -v "$benchcont" | grep -E "$pattern")
|
containers=$(docker ps | sed '1d' | awk '{print $NF}' | grep -v "$benchcont" | grep -E "$pattern")
|
||||||
images=$(docker images | grep -E "$pattern" | sed '1d' | awk '{print $3}' | grep -v "$benchimagecont")
|
images=$(docker images | sed '1d' | grep -E "$pattern" | awk '{print $3}' | grep -v "$benchimagecont")
|
||||||
elif [ -n "$exclude" ]; then
|
elif [ -n "$exclude" ]; then
|
||||||
pattern=$(echo "$exclude" | sed 's/,/|/g')
|
pattern=$(echo "$exclude" | sed 's/,/|/g')
|
||||||
containers=$(docker ps | sed '1d' | awk '{print $NF}' | grep -v "$benchcont" | grep -Ev "$pattern")
|
containers=$(docker ps | sed '1d' | awk '{print $NF}' | grep -v "$benchcont" | grep -Ev "$pattern")
|
||||||
images=$(docker images | grep -Ev "$pattern" | sed '1d' | awk '{print $3}' | grep -v "$benchimagecont")
|
images=$(docker images | sed '1d' | grep -Ev "$pattern" | awk '{print $3}' | grep -v "$benchimagecont")
|
||||||
else
|
else
|
||||||
containers=$(docker ps | sed '1d' | awk '{print $NF}' | grep -v "$benchcont")
|
containers=$(docker ps | sed '1d' | awk '{print $NF}' | grep -v "$benchcont")
|
||||||
images=$(docker images -q | grep -v "$benchcont")
|
images=$(docker images -q | grep -v "$benchcont")
|
||||||
|
|
Loading…
Reference in a new issue