mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-10-28 08:38:58 +00:00
Make the main script an executable for if I want to run it on my host
Fix image sprawl to work Fix port range Signed-off-by: Jessica Frazelle <princess@docker.com>
This commit is contained in:
parent
d48d691ec2
commit
0231a7f5de
3 changed files with 16 additions and 13 deletions
|
|
@ -40,8 +40,8 @@ images=$(docker images -q | wc -l | awk '{print $1}')
|
|||
active_images=0
|
||||
|
||||
for c in $(docker inspect -f "{{.Image}}" $(docker ps -qa)); do
|
||||
if [[ $(docker images --no-trunc -a | grep $c) ]]; then
|
||||
((active_images++))
|
||||
if docker images --no-trunc -a | grep $c > /dev/null ; then
|
||||
active_images=$(( active_images += 1 ))
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ else
|
|||
info " * There are currently: $images images"
|
||||
fi
|
||||
|
||||
if [[ "$active_images" -lt "$((images / 2))" ]]; then
|
||||
if [ "$active_images" -lt "$((images / 2))" ]; then
|
||||
warn " * Only $active_images out of $images are in use"
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue