From 125eaf90cd5a81774bf0a92f9612f8f7df784ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Fri, 7 Jul 2017 12:07:00 +0200 Subject: [PATCH] inspect requires images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/6_docker_security_operations.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/6_docker_security_operations.sh b/tests/6_docker_security_operations.sh index d56c87d..e2fd264 100644 --- a/tests/6_docker_security_operations.sh +++ b/tests/6_docker_security_operations.sh @@ -8,7 +8,7 @@ check_6_1="6.1 - Avoid image sprawl" images=$(docker images -q | sort -u | wc -l | awk '{print $1}') active_images=0 -for c in $(docker inspect -f "{{.Image}}" $(docker ps -qa)); do +for c in $(docker inspect -f "{{.Image}}" $(docker ps -qa) 2>/dev/null); do if docker images --no-trunc -a | grep "$c" > /dev/null ; then active_images=$(( active_images += 1 )) fi