mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-18 16:22:33 +01:00
Fixed running containers calculation
This commit is contained in:
parent
1c795f146e
commit
8d06000296
1 changed files with 1 additions and 1 deletions
|
@ -48,7 +48,7 @@ fi
|
||||||
# 6.7
|
# 6.7
|
||||||
check_6_7="6.7 - Avoid container sprawl"
|
check_6_7="6.7 - Avoid container sprawl"
|
||||||
total_containers=`docker info 2>/dev/null | grep "Containers" | awk '{print $2}'`
|
total_containers=`docker info 2>/dev/null | grep "Containers" | awk '{print $2}'`
|
||||||
running_containers=`printf $containers | wc -l | awk '{print $1}'`
|
running_containers=`docker ps -q | wc -l | awk '{print $1}'`
|
||||||
diff=`expr "$total_containers" - "$running_containers"`
|
diff=`expr "$total_containers" - "$running_containers"`
|
||||||
if [ $diff -gt 25 ]; then
|
if [ $diff -gt 25 ]; then
|
||||||
warn "$check_6_7"
|
warn "$check_6_7"
|
||||||
|
|
Loading…
Reference in a new issue