title: Unable to connect to mongoDB running in docker container
body: <p>Following this example: <a href="https://docs.docker.com/engine/examples/mongodb/" rel="noreferrer">https://docs.docker.com/engine/examples/mongodb/</a></p>
  
  <p>When trying to connect to mongoDB with: <code>mongo ip:27017</code>
  (where ip is the name from boot2docker ip) + the port number from docker ps: <br></p>
  
  <p>27017/tcp<br>
  or with -P<br>
  0.0.0.0:49155->27017/tcp</p>
  
  <p>Either way I get the following errors:</p>
  
  <blockquote>
    <p>warning: Failed to connect to ip:27017, reason: errno:61 Connection
    refused</p>
    
    <p>Error: couldn't connect to server ip:27017 (ip), connection attempt
    failed at src/mongo/shell/mongo.js:148 exception: connect failed</p>
  </blockquote>