Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-902

Connect to Atlas within Docker Container

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.0.0-rc2
    • Component/s: Connections
    • Labels:
    • Environment:
      Docker version 18.09.2, build 6247962
      go.mongodb.org/mongo-driver v1.0.0/1c3b9b9
      Multistage-Docker-build with: golang:1.12 & ubuntu:18.04

      When I shipped my Go application with Docker, I couldn't connect to the mongoDB atlas cluster anymore. Running it locally was not a problem. I can also reach the atlas cluster with the Mongo shell from inside the container. Connecting to a local instance of mongoDB inside another container is also no problem. 

       

      URL:

      mongodb+srv://<USER>:<PASSWORD>@<Cluster-Name>.gcp.mongodb.net/test?retryWrites=true 

      Error: 

      2019/03/25 18:05:34 Mongodb-Ping failed:server selection error: server selection timeout
       current topology: Type: ReplicaSetNoPrimary
       Servers:
       Addr: tarsi-test-shard-00-00-jr80d.gcp.mongodb.net:27017, Type: Unknown, State: Connected, Avergage RTT: 0, Last error: x509: certificate signed by unknown authority
       Addr: tarsi-test-shard-00-01-jr80d.gcp.mongodb.net:27017 ...

            Assignee:
            Unassigned Unassigned
            Reporter:
            email@felixleber.de Felix Leber
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: