mr coder
mr coder

Reputation: 209

run mongo in docker container

i want to run mongoDb with docker in windows 10 for nodejs Project .

i run this command :

docker run --name CMSStore -p 27011:27017 -v e:/data/mongo:/data/db mongo    

but it stop in this stop and not run .

enter code here

whats the problem ? how can i run mongo with save data in valume ????

Upvotes: 1

Views: 376

Answers (1)

SavulescuAdrian
SavulescuAdrian

Reputation: 43

Please try:

docker run -d -p 27017:27017 -v ~/data:/data/db mongo

Are you sure that 27011 is listening ? why you using it? Default port are here : https://docs.mongodb.com/manual/reference/default-mongodb-port/ 27017, 27018, 27019.

To see if mongodb is listening on 27011, check this command on mongo shell:

db.runCommand({whatsmyuri : 1})

it will display IP and port numbers in use.

Upvotes: 2

Related Questions