mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-31 14:22:33 +01:00
fix count total_containers for swarm mode
Signed-off-by: Daniele Marcocci <daniele.marcocci@par-tec.it>
This commit is contained in:
parent
f7518b4d7a
commit
77074962b1
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ check_6_1() {
|
||||||
check_6_2() {
|
check_6_2() {
|
||||||
check_6_2="6.2 - Avoid container sprawl"
|
check_6_2="6.2 - Avoid container sprawl"
|
||||||
totalChecks=$((totalChecks + 1))
|
totalChecks=$((totalChecks + 1))
|
||||||
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=$(docker ps -q | wc -l | awk '{print $1}')
|
running_containers=$(docker ps -q | wc -l | awk '{print $1}')
|
||||||
diff="$((total_containers - running_containers))"
|
diff="$((total_containers - running_containers))"
|
||||||
if [ "$diff" -gt 25 ]; then
|
if [ "$diff" -gt 25 ]; then
|
||||||
|
|
Loading…
Reference in a new issue