• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

My docker cannot mount mongo to a local volume

 
Ranch Hand
Posts: 1772
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running a Spring Boot mongodb example from John Thompson's course.
I am using Window 10 while John Thompson is using Mac/Linux.  I heard Docker may not be working properly in Windows.
According to John, Docker is a "Linux" thing.

I installed Docker for Windows (Edge release, engine 18.09.0)
I tried both Linux and Windows containers in Docker.
In my local directory:
c:\users\myname\desktop> docker run -p 27017:27017 -v /dockerdata/mongo -d mongo

I have already share my C drive with the container.
I have a dockerdata/mongo directory in my desktop.

After running the Spring boot example, I should have some data persisted in dockerdata/mongo directory as instructed.
However, my dockerdata/mongo directory is still empty.

I am running out of idea now.
Please help.
It seems like my mongo data is not persisted in the directory I mounted to.
Thanks in advance.
shared_c.JPG
[Thumbnail for shared_c.JPG]
 
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!