From 0cbd4e25370dce9dd0358b7d75082725558760a5 Mon Sep 17 00:00:00 2001 From: Arno Hautala Date: Fri, 1 Apr 2022 16:42:57 -0400 Subject: [PATCH 1/2] blacklist support --- docker-entrypoint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-entrypoint b/docker-entrypoint index eb482bf..fd376ce 100755 --- a/docker-entrypoint +++ b/docker-entrypoint @@ -97,7 +97,7 @@ if [ "$1" = "autoheal" ] && [ -e "$DOCKER_SOCK" ];then do STOP_TIMEOUT=".Labels[\"autoheal.stop.timeout\"] // $AUTOHEAL_DEFAULT_STOP_TIMEOUT" get_container_info | \ - jq -r "foreach .[] as \$CONTAINER([];[]; \$CONTAINER | .Id, .Names[0], .State, ${STOP_TIMEOUT})" | \ + jq -r ".[] | select(.Labels[\"autoheal\"] != \"False\") | foreach . as \$CONTAINER([];[]; \$CONTAINER | .Id, .Names[0], .State, ${STOP_TIMEOUT})" | \ while read -r CONTAINER_ID && read -r CONTAINER_NAME && read -r CONTAINER_STATE && read -r TIMEOUT do # shellcheck disable=2039 From a47a09ac29c218276d4448a9bed56ab34dc0a200 Mon Sep 17 00:00:00 2001 From: Arno Hautala Date: Fri, 1 Apr 2022 16:48:55 -0400 Subject: [PATCH 2/2] readme note --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f9bcdcb..e71e3b9 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ b) Set ENV `AUTOHEAL_CONTAINER_LABEL=all` to watch all running containers. c) Set ENV `AUTOHEAL_CONTAINER_LABEL` to existing label name that has the value `true`. +Note: You can also exclude a container (eg. if using `AUTOHEAL_CONTAINER_LABEL=all`) by setting the label `autoheal=false`. + Note: You must apply `HEALTHCHECK` to your docker images first. See https://docs.docker.com/engine/reference/builder/#healthcheck for details. See https://docs.docker.com/engine/security/https/ for how to configure TCP with mTLS