Following this example: https://docs.docker.com/engine/examples/mongodb/
When trying to connect to mongoDB with: mongo ip:27017
(where ip is the name from boot2docker ip) + the port number from docker ps:
27017/tcp
or with -P
0.0.0.0:49155->27017/tcp
Either way I get the following errors:
warning: Failed to connect to ip:27017, reason: errno:61 Connection refused
Error: couldn't connect to server ip:27017 (ip), connection attempt failed at src/mongo/shell/mongo.js:148 exception: connect failed
docker logs <container>
andps
to check that mongodb is actually running and listening on the port you exposed. – ZeissSdocker ps
for the container? I think you confused the internal port with the public port. – ZeissS