title: Can't connect Docker + PostgreSQL 9.3
body: <p>Can anyone help me on this? I'm using Mac OS X El Capitan + Docker. </p>
  
  <p>Dockerfile for my image:</p>
  
  <p><a href="https://gist.github.com/andrealmar/bce56f7d8450990333703aa5c4ac8d61" rel="nofollow">https://gist.github.com/andrealmar/bce56f7d8450990333703aa5c4ac8d61</a></p>
  
  <p>I run my container: </p>
  
  <pre><code>docker run andrealmar/postgresql:9.3
  </code></pre>
  
  <p><em>docker ps</em> shows that my container is running and I do a <em>docker inspect</em> to see which IP address the container has:</p>
  
  <pre><code>docker inspect 8e65f4dec821 | grep IPAddress
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>"SecondaryIPAddresses": null,
      "IPAddress": "172.17.0.2",
          "IPAddress": "172.17.0.2",
  </code></pre>
  
  <p>When I try to connect using psql:</p>
  
  <pre><code>psql -h 172.17.0.2 -U docker docker
  </code></pre>
  
  <p>It gives me a timeout error. </p>
  
  <pre><code>psql: could not connect to server: Operation timed out
      Is the server running on host "172.17.0.2" and accepting
      TCP/IP connections on port 5432?
  </code></pre>
  
  <p>I've tried also with the command:</p>
  
  <pre><code>psql -h 172.17.0.2 -p 5432 -d docker -U docker -W 
  </code></pre>
  
  <p>But the same Timeout error happens....</p>
  
  <p>Does anyone knows what I'm missing here?</p>
  
  <p>Cheers,</p>