title: How can one Docker Container find the IP address of another Docker Container?
body: <p>Working on my first MSA application, and trying to figure out how a Docker container can find the IP address of another Docker Container?  My containers know the name of the other container it needs to connect to, but that is it.  I can't use a "--link" option or docker-compose as the components can come an go at different times, and I need a programmatic way to find the IP address of the other containers and start connections to them.</p>
  
  <p>I have to think this problem has already been solved long long ago, but my GoogleFoo must be very weak today, as I can't find anything!</p>
  
  <p>Thanks for your help! :)</p>
  
  <p>AAR:
  So the issue is that on the default 'bridge' bridge network, the Docker DNS does NOT keep track of container names...all other network types it will.</p>
  
  <p>So the accepted solution below is to use any other network and have the containers use that network.</p>
  
  <p>I created another bridge network so that I can still do testing/dev work, and my containers can find one another by name now. For production, I will have to change the network to something like a 'macvlan' type.</p>
  
  <p>If you are using something like Kubernetes, then you will need a Service Discovery solution like Zookeeper or Consul.</p>