From 54214478045c219fd5367f2076f6471b2c8d3cd0 Mon Sep 17 00:00:00 2001 From: Marek Date: Wed, 24 May 2023 18:56:22 +0200 Subject: [PATCH] Listen on `0.0.0.0` instead of `127.0.0.1` (#6755) Binding `127.0.0.1` means that Zebra will accept inbound connections coming only from the loopback network interface. This is desirable as long as Zebra runs on a native machine. When Zebra runs inside a Docker container, incoming connections coming from the host machine don't come from the container's loopback interface. In order to be able to connect to Zebra from the host machine, we can listen on `0.0.0.0` so Zebra accepts inbound connections coming from any interface. Users then can limit inbound connection to the loopback of their host by ```bash docker run -p 127.0.0.1:8232:8232 zfnd/zebra:1.0.0-rc.8 ``` --- docker/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 180a50e52..68d0a95be 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -180,18 +180,18 @@ RUN set -ex; \ { \ echo "[network]"; \ echo "network = '${NETWORK}'"; \ - echo "listen_addr = '127.0.0.1'"; \ + echo "listen_addr = '0.0.0.0'"; \ echo "[consensus]"; \ echo "checkpoint_sync = ${CHECKPOINT_SYNC}"; \ echo "[state]"; \ echo "cache_dir = '/zebrad-cache'"; \ echo "[rpc]"; \ - [ -n "$RPC_PORT" ] && echo "listen_addr = '127.0.0.1:${RPC_PORT}'"; \ + [ -n "$RPC_PORT" ] && echo "listen_addr = '0.0.0.0:${RPC_PORT}'"; \ echo "parallel_cpu_threads = 0"; \ echo "[metrics]"; \ - echo "#endpoint_addr = '127.0.0.1:9999'"; \ + echo "#endpoint_addr = '0.0.0.0:9999'"; \ echo "[tracing]"; \ - echo "#endpoint_addr = '127.0.0.1:3000'"; \ + echo "#endpoint_addr = '0.0.0.0:3000'"; \ } > "${ZEBRA_CONF_PATH}"