From 95c1e9e94232fe2387b34fdbe6f3de3dcdfdc1d4 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