title: How we can map docker ip in external application
body: <p>I installed zookeeper and Kafka using docker with help of following link
  <a href="https://crunchytechbytz.wordpress.com/2018/01/28/install-apache-kafka-in-docker-container/" rel="nofollow noreferrer">https://crunchytechbytz.wordpress.com/2018/01/28/install-apache-kafka-in-docker-container/</a></p>
  
  <p>Now I want to publish a message on one of the topic in kafka. 
  If I get ip of docker kafka by using the following command.</p>
  
  <pre><code>docker network inspect kafka-net
  </code></pre>
  
  <p>I use this ip in my application. I am able to publish message to kafka queue. How we can do the automatic mapping. </p>
  
  <p>I tried one-way mapping docker container port to mapping outer port. This makes it very slow and After this consumer also not able to consume this.</p>