fix: healthcheck — use IPv4 and busybox-compatible nc
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.
This commit is contained in:
+1
-1
@@ -56,7 +56,7 @@ EXPOSE 79
|
|||||||
|
|
||||||
# Add health check
|
# Add health check
|
||||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
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
|
# Set metadata labels
|
||||||
LABEL org.opencontainers.image.title="finger"
|
LABEL org.opencontainers.image.title="finger"
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ services:
|
|||||||
- ./users:/var/finger/users
|
- ./users:/var/finger/users
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-z", "localhost", "79"]
|
test: ["CMD-SHELL", "nc -w 1 127.0.0.1 79 < /dev/null || exit 1"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|||||||
Reference in New Issue
Block a user