Giter VIP home page Giter VIP logo

Comments (9)

m-amr avatar m-amr commented on June 29, 2024 45

try to make the whole data directory as a volume
instead of

volumes:
- ./data/db:/data/db

try
volumes:
- ./data:/data

it works for me.

from mongo.

tianon avatar tianon commented on June 29, 2024 5

Since the Dockerfile defines a volume on /data/db, if you only mount /data you will not be keeping your data. If you check our data folder on your host, you'll see that it has a db subdirectory, but it should be empty, because it's in a separate volume.

from mongo.

jtmarmon avatar jtmarmon commented on June 29, 2024

ah, this is resolved via the --smallfiles option

from mongo.

unoexperto avatar unoexperto commented on June 29, 2024

Sadly it didn't help me. Any other options guys ? I run it via

docker run -p 127.0.0.1:27017:27017 --name mymongo -d mongo:3.1.6 --smallfiles

from mongo.

MattMoranJava avatar MattMoranJava commented on June 29, 2024

Doesn't work for me either. Trying to run mongodb docker container in Windows 10. I'm using:
docker run --name mongodb_svcrm -p 27017:27017 -v C:\Users\matt.moran\Documents\myproject\data\db:/data/db -d mongo --smallfiles
docker ps -a shows it exits with code 100. There's plenty of disk space in the host system for journals.
Any idea why this is happening?

from mongo.

yosifkit avatar yosifkit commented on June 29, 2024

@MattMoranJava for Docker on Windows, see #107 (comment)

from mongo.

m-amr avatar m-amr commented on June 29, 2024

@tianon you are right this doesn't solve the problem.

from mongo.

aorlenko avatar aorlenko commented on June 29, 2024

So are there any solutions to this? Should directory mounting work with mongo:windowsservercore image?

from mongo.

yosifkit avatar yosifkit commented on June 29, 2024

@aorlenko, current solutions are to mount a folder from the VM (#74 (comment)) or use a named volume (#74 (comment)).

Yes, the windowsservercore images work just fine if you are using windows containers:

PS C:\Users\Docker\docker> docker run -d --name mongo -v C:\Users\Docker\docker\mongo-data:C:\data\db mongo:3.4-windowsservercore
PS C:\Users\Docker\docker> ls .\mongo-data\


    Directory: C:\Users\Docker\docker\mongo-data


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        9/13/2017   2:30 PM                diagnostic.data
d-----        9/13/2017   2:30 PM                journal
-a----        9/13/2017   2:30 PM          16384 collection-0--6462546833303440715.wt
-a----        9/13/2017   2:30 PM          16384 collection-2--6462546833303440715.wt
-a----        9/13/2017   2:30 PM          16384 index-1--6462546833303440715.wt
-a----        9/13/2017   2:30 PM          16384 index-3--6462546833303440715.wt
-a----        9/13/2017   2:30 PM          16384 index-4--6462546833303440715.wt
-a----        9/13/2017   2:30 PM              0 mongod.lock
-a----        9/13/2017   2:30 PM          16384 sizeStorer.wt
-a----        9/13/2017   2:30 PM             95 storage.bson
-a----        9/13/2017   2:30 PM             49 WiredTiger
-a----        9/13/2017   2:30 PM             21 WiredTiger.lock
-a----        9/13/2017   2:30 PM            986 WiredTiger.turtle
-a----        9/13/2017   2:30 PM          24576 WiredTiger.wt
-a----        9/13/2017   2:30 PM           4096 WiredTigerLAS.wt
-a----        9/13/2017   2:30 PM          16384 _mdb_catalog.wt


PS C:\Users\Docker\docker>

from mongo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.