mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 00:32:34 +01:00
Merge pull request #305 from danielino/master
fix count total_containers for swarm mode
This commit is contained in:
commit
b926f0446a
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ check_6_1() {
|
|||
check_6_2() {
|
||||
check_6_2="6.2 - Avoid container sprawl"
|
||||
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}')
|
||||
diff="$((total_containers - running_containers))"
|
||||
if [ "$diff" -gt 25 ]; then
|
||||
|
|
Loading…
Reference in a new issue