From b1b0ec8709cf9b34fb37b33b4c91b91f1312a27e Mon Sep 17 00:00:00 2001 From: Martin Honermeyer Date: Thu, 12 Nov 2015 00:32:06 +0100 Subject: [PATCH] Fix rpcallowip to use the real bridge IP in the Docker container This is needed for Docker >=1.9 because the bridge IP is not necessarily 172.17.42.1 anymore. (See https://github.com/docker/docker/issues/17305 for reference.) refs #357 --- Dockerfile | 2 +- docker-entrypoint.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 35948d74..14429b7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,5 +21,5 @@ ENV HOME /root VOLUME /root/.twister # Run twisterd by default -ENTRYPOINT ["/twister-core/twisterd", "-rpcuser=user", "-rpcpassword=pwd", "-rpcallowip=172.17.42.1", "-htmldir=/twister-html", "-printtoconsole", "-port=28333"] +ENTRYPOINT ["/twister-core/docker-entrypoint"] EXPOSE 28332 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 00000000..726c383c --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +BRIDGE_IP=$(ip ro get 8.8.8.8 | grep -oP '(?<=via )([\d\.]+)') + +exec /twister-core/twisterd -rpcuser=user -rpcpassword=pwd -rpcallowip=${BRIDGE_IP} -htmldir=/twister-html -printtoconsole -port=28333 $*