title: How to connect to mongodb as a docker image from another container app
body: <p>Firstly I pulled mongoDb image</p>
  
  <pre><code>sudo docker pull mongo
  </code></pre>
  
  <p>and run docker mongodb container:</p>
  
  <pre><code>sudo docker run --name database -d -p 27017:27017 mongo --noauth --bind_ip=0.0.0.0
  </code></pre>
  
  <p>I see that my docker container works:</p>
  
  <pre><code>300b779a63a9        mongo               "docker-entrypoint..."   30 minutes ago      Up 30 minutes  
  </code></pre>
  
  <p>and now Im trying to connect to it with my docker app</p>
  
  <pre><code>sudo docker run -v ~/Desktop/Template/universal_skillskill -it --link 300b779a63a9:300b779a63a9 alexa
  </code></pre>
  
  <p>and... Im getting a message that the connection is refused :(</p>
  
  <pre><code>Uncaught exception: MongoError: failed to connect to server [0.0.0:27017] on first connect [MongoError: connect ECONNREFUSED 0.0.0.0:27017]
  MongoError: failed to connect to server [0.0.0:27017] on first connect [MongoError: connect ECONNREFUSED 0.0.0.0:27017]
  </code></pre>
  
  <p>I checked and my app works with mongodb installed locally but it doesnt communicate with docker mongoDb container :( What am I doing wrong? Could somebody smart help me please :)</p>