I’m having an issue connecting the
mongo CLI tool to a
mongod container. Since it works locally I guess this could be an issue with Docker Cloud links.
These are my two containers:
cli: image: 'mongo:latest' command: 'sh -c ''exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"''' links: - 'db:mongo' db: image: 'mongo:latest'
db service starts successfully, the
cli container fails with this error:
MongoDB shell version: 3.2.6
connecting to: 10.7.0.7:27017/test
2016-05-15T23:10:32.835+0000 W NETWORK [thread1] Failed to connect to 10.7.0.7:27017, reason: errno:113 > No route to host
2016-05-15T23:10:32.836+0000 E QUERY [thread1] Error: couldn’t connect to server 10.7.0.7:27017, connection attempt failed :
exception: connect failed
Now the same happens if I expose the
db: image: 'mongo:latest' ports: - '27017:27017'
Could anyone try the Stackfile from above? In my opinion this should work, as it does with the latest Docker version on my computer.