title: Docker instance connect to local Mongo: can't bind to address
body: <p>I have a dockerized (NodeJS) app that uses MongoDB.
  In my local environment (Mac OS) I can run my container with the command</p>
  
  <pre><code>docker run -e MONGO_URL='mongodb://host.docker.internal:27017/mydb' -p 8070:8000 -p 27017:27017 -d myimage:8933f
  </code></pre>
  
  <p>It works fine, it connects to a local MongoDB instance (which is not dockerized, it is a standard installation).</p>
  
  <p>The problem is when I try to run the same image in an Ubuntu server. It has too an MongoDB running on port 27017.
  When I try to run the image with the same command, it outputs:</p>
  
  <blockquote>
    <p>docker: Error response from daemon: driver failed programming external
    connectivity on endpoint priceless_cartwright
    (4a44248e01133f837144196943f6e034cb1a701a2bf783cde6e4996ea4889e4d):
    Error starting userland proxy: listen tcp 0.0.0.0:27017: bind: address
    already in use</p>
  </blockquote>
  
  <p>I can't figure out what may be happening. I tried to start a MongoDB with Docker with another port (27117) and change the connecting port in my docker run command, but the problem is the same.</p>
  
  <p>Any help? </p>