From 5d44c174931570657aa1148bd7743da4e9cd64e0 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 26 Mar 2023 17:31:50 +0200 Subject: [PATCH] Optimized docker-health-check --- roles/native-docker-health-check/files/docker-health-check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/native-docker-health-check/files/docker-health-check.sh b/roles/native-docker-health-check/files/docker-health-check.sh index ec0ca904..f6c74efe 100644 --- a/roles/native-docker-health-check/files/docker-health-check.sh +++ b/roles/native-docker-health-check/files/docker-health-check.sh @@ -1,6 +1,6 @@ #!/bin/sh -docker_ps_grep_unhealthy="$(docker ps | grep unhealthy)" -docker_ps_grep_exited="$(docker ps -a | grep Exited)" +docker_ps_grep_unhealthy="$(docker ps --filter health=unhealthy)" +docker_ps_grep_exited="$(docker ps --filter status=exited)" exitcode=0 if [ ! -z "$docker_ps_grep_unhealthy" ] then