Docker Community Forums

Share and learn in the Docker community.

Unable to run mongodb as a daemon process


(Pmandayam) #1

I am running docker on windows with the docker-machine and Docker Toolbox installation package.

Boot2Docker is now deprecated, btw.

The docs here: https://docs.docker.com/examples/mongodb/ told me to connect to the running mongodb container like:

$ mongo --port 27017 --host 192.168.99.100
But I get this error:

$ mongo --host 192.168.99.100
sh: mongo: command not found
Any ideas?

EDIT 1: I run the container like this:

$ docker run -p 27017:27017 --name mongodb -d myname/repo


(Joe) #2

Hi,

This looks like a UNIX problem.

Where is mongo installed? Is the /bin in your PATH?

Confirm that it is, and then try.

Cheers,
Joe


(Dolphyvn) #3

Yeah, look like you have to check if you at-least have mongo client installed on your docker host. If yes check whether it has execute permission and in PATH ENV.


(Pmandayam) #4

@dolphyvn @sapjpp ahh I see, I have to add it to my path. Thanks to both of you.