Run MongoDB in a Docker container on Docker for Windows

Just a note to self on how to run a MongoDB instance using Docker for Windows.

Create a volume to persist the Mongo database:

>docker volume create --name=mongodata

 

 

The run a MongoDB instance:

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *