3

Operating System :- windows 10

I am using Docker toolbox and Install MongoDB Image on my local system. Image installation done successfully.

enter image description here

after that I am using command docker exec -it taxlien bash to connect with mongo db and it connected successfully but I am unable to connect through our local using MongoDB Compass Community and also through our web application.

enter image description here

Yuankun
  • 6,875
  • 3
  • 32
  • 34
Ajay Jirati
  • 171
  • 12
  • Does it works with command line? without connect inside the container but connect from your host to your container with the mongoDB cli – Kilian May 03 '18 at 14:41
  • Thank you for you response, yes after executing shared command it will connect to database and through command line I am able to execute database. – Ajay Jirati May 03 '18 at 14:45
  • Hi Aartek, can I make a suggestion about your question? Images are useful in a post, but **make sure the post is still clear without them**. Instead of showing screenshots of the docker ps information, and the compass problem, it would be better if you could copy and paste or type the actual text into the post directly. cf http://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors – Vince Bowdren May 03 '18 at 15:41

2 Answers2

1

Now Finally I got solution using cmd docker-machine ip default , I got IP address after that I will execute cmd

docker run -p :27017 --name test -d mongo:3.6

then i will connect with my local application and MongoDB commuinty.

Ajay Jirati
  • 171
  • 12
0

Try this docker-machine ip default, and replace localhost by the result

See How do I connect to a container hosted in Docker Toolbox?

And check this doc https://docs.docker.com/toolbox/toolbox_install_windows/#optional-add-shared-directories

Kilian
  • 1,753
  • 13
  • 21