Install Mongo DB with a volume mount to write data on the physical machine
MD
R
MarkdownThis 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.
- Pull an official docker image from DockerHub docker pull mongo
- 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
- Print Logs docker logs mongo
Created on 6/15/2017