From d022504eea4d4e9bbdd902cd696254b331ae0cde Mon Sep 17 00:00:00 2001 From: David Giesberg Date: Tue, 9 Feb 2016 11:07:55 -0600 Subject: [PATCH] Fixes `advertised.host.name` resolution in Docker 1.10.0 `start.sh` should now correctly pick up the container's IP, no matter where it shows up in `/etc/hosts`, instead of expecting it to be in the first line Resolves ches/docker-kafka#13 --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 561c8ff..1cd6a98 100755 --- a/start.sh +++ b/start.sh @@ -5,7 +5,7 @@ [ -n "$ZOOKEEPER_PORT_2181_TCP_ADDR" ] && ZOOKEEPER_IP=$ZOOKEEPER_PORT_2181_TCP_ADDR [ -n "$ZOOKEEPER_PORT_2181_TCP_PORT" ] && ZOOKEEPER_PORT=$ZOOKEEPER_PORT_2181_TCP_PORT -IP=$(cat /etc/hosts | head -n1 | awk '{print $1}') +IP=$(grep ${HOSTNAME} /etc/hosts | awk '{print $1}') # Concatenate the IP:PORT for ZooKeeper to allow setting a full connection # string with multiple ZooKeeper hosts