Install Mongo DB with a volume mount to write data on the physical machine

MD
R
Markdown

This resource guides you through installing MongoDB using Docker with a volume mount, allowing data to persist on your physical machine. Perfect for developers who want to leverage MongoDB's power in a containerized environment while maintaining data durability and easy access for backups or migrations.

  1. Pull an official docker image from DockerHub docker pull mongo
  2. Create & Start an instance of the container with an image mount on the local hdd @/usr/local/var/mongodb (-v virtual mount) docker run -d --name mongo -p 27017:27017 -v /usr/local/var/mongodb:/data/db mongo
  3. Print Logs docker logs mongo

Created on 6/15/2017