title: How to get local host IP address in docker container?
body: <p>I am using docker and run using script. I want to change in one of configuration with host machine IP address in docker. </p>
  
  <pre><code>#!/bin/bash
  IP=$(echo `ifconfig eth0 2&gt;/dev/null|awk '/inet addr:/ {print $2}'|sed   's/addr://'`)
  echo Setting xwiki config IP
  CONFIG=/xwiki/webapps/xwiki/WEB-INF/xwiki.cfg
  sed -i -e "s/^xwiki.authentication.authhost=localhost*/xwiki.authentication.authhost= $IP/"  $CONFIG
  </code></pre>
  
  <p>/xwiki/start_xwiki.sh -f</p>
  
  <p>I run my docker with following command.</p>
  
  <pre><code>docker run -t -i $EXPOSE_PORTS $IMAGE "$@"
  </code></pre>