From 676d1700e1fb9b751211e4f7a4ea0fa81bd2b8b1 Mon Sep 17 00:00:00 2001 From: waffle2k Date: Sat, 16 May 2026 21:06:05 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20healthcheck=20=E2=80=94=20use=20IPv4=20a?= =?UTF-8?q?nd=20busybox-compatible=20nc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Alpine runtime stage uses BusyBox nc, which has no -z flag, and 'localhost' resolves to ::1 while finger only binds 0.0.0.0:79. Both combined caused every healthcheck to fail (35k+ failing streak on mammut). Use '-w 1 127.0.0.1 79 < /dev/null' instead. --- Dockerfile | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8353adb..37cc8a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,7 +56,7 @@ EXPOSE 79 # Add health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD nc -z localhost 79 || exit 1 + CMD nc -w 1 127.0.0.1 79 < /dev/null || exit 1 # Set metadata labels LABEL org.opencontainers.image.title="finger" diff --git a/docker-compose.yml b/docker-compose.yml index 7bade87..2e6ba5d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: - ./users:/var/finger/users restart: unless-stopped healthcheck: - test: ["CMD", "nc", "-z", "localhost", "79"] + test: ["CMD-SHELL", "nc -w 1 127.0.0.1 79 < /dev/null || exit 1"] interval: 30s timeout: 10s retries: 3