title: Cross container communication with Docker
body: <p>An application server is running as one Docker container and database running in another container. IP address of the database server is obtained as:</p>
  
  <pre><code>sudo docker inspect -f '{{ .NetworkSettings.IPAddress }}' db
  </code></pre>
  
  <p>Setting up JDBC resource in the application server to point to the database gives "java.net.ConnectException".</p>
  
  <p>Linking containers is not an option since that only works on the same host.</p>
  
  <p>How do I ensure that IP address of the database container is visible to the application server container?</p>