title: Connect to a docker mongo instance from remote server
body: <p>This should be really simple but I can't find any answer
  I installed docker on a server
  I am running mongo on it </p>
  
  <pre><code>docker run --name some-mongo -d mongo
  </code></pre>
  
  <p>I have one user</p>
  
  <pre><code>$ docker exec -it some-mongo mongo admin
  connecting to: admin
  &gt; db.createUser({ user: 'jsmith', pwd: 'some-initial-password', roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] });
  Successfully added user: {
      "user" : "jsmith",
      "roles" : [
          {
              "role" : "userAdminAnyDatabase",
              "db" : "admin"
          }
      ]
  }
  </code></pre>
  
  <p>And when I am trying to connect from an other server</p>
  
  <pre><code>mongo my-server.com:27017/admin -u jsmith -p some-initial-password
  </code></pre>
  
  <p>I have </p>
  
  <pre><code>MongoDB shell version: 3.2.0
  connecting to: infra1.host.com:27017/admin
  2016-08-01T19:06:08.409+0100 W NETWORK  [thread1] Failed to connect to 54.93.113.11:27017, reason: errno:61 Connection refused
  2016-08-01T19:06:08.410+0100 E QUERY    [thread1] Error: couldn't connect to server my-server.com:27017, connection attempt failed :
  connect@src/mongo/shell/mongo.js:226:14
  @(connect):1:6
  </code></pre>