• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

My docker cannot mount mongo to a local volume

Posts: 1955
  • 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.
[Thumbnail for shared_c.JPG]
machines help you to do more, but experience less. Experience this tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic