Bind 0.0.0.0 to IPv4 only (closes #528)
check / check (push) Waiting to run

Go listens on any unspecified address with one socket that answers
IPv4 and IPv6, so BIND_ADDRESS=0.0.0.0 also bound every IPv6 address,
which the README says it does not. The listener now uses tcp4 for an
IPv4 address; :: still binds both. The server's start hook suppresses
contextcheck, as the other start hooks do.

The image's health check asked for localhost, which wget reached over
::1 only, so it now asks for 127.0.0.1. The README says what that
means for a loopback bind in a container, drops the bindv6only
condition from :: (Go sets that socket option itself), and names an
ss check.

Model: opus-5-5
This commit is contained in:
2026-10-15 08:20:43 +00:00
parent 573f7f986a
commit 615ba5bf72
5 changed files with 112 additions and 12 deletions
+4 -1
View File
@@ -274,8 +274,11 @@ EXPOSE 8080
# port.
ENV BIND_ADDRESS=0.0.0.0
# The address is 127.0.0.1 because wget tries only the first address
# localhost resolves to. That can be ::1, which a 0.0.0.0 bind does
# not answer.
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/.well-known/healthcheck || exit 1
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:8080/.well-known/healthcheck || exit 1
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["/app/webhooker"]