Comments (9)
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.
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.
ah, this is resolved via the --smallfiles
option
from mongo.
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.
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.
@MattMoranJava for Docker on Windows, see #107 (comment)
from mongo.
@tianon you are right this doesn't solve the problem.
from mongo.
So are there any solutions to this? Should directory mounting work with mongo:windowsservercore image?
from mongo.
@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)
- Add an example to documentation for "Initializing a fresh instance" HOT 1
- docker run mongo failed
- Mongo 6.0+ Fails to Run Using WSL HOT 6
- Is it possible Docker without WSL?
- Need help with CVE-2023-24538, CVE-2023-24540, CVE-2024-21626 and CVE-2023-27561 HOT 4
- Not connecting in the mongodb compass - getaddrinfo ENOTFOUND db-mongo-node17 HOT 6
- Mongo container sends network requests to mysterious EC2 servers at AWS HOT 9
- MongoDB container not always initialising after clearing volumes HOT 1
- 7.0.7 tag is missing linux/arm64 image HOT 1
- mongod:6.0.13 - Failed during mongod binary build in docker image.
- docker PIDS keeps increasing at 7.0.8 HOT 1
- Can't connect apps to MongoDB inside docker in Linux HOT 2
- `ENTRYPOINT` documentation HOT 1
- The docker container is throwing connection error if host machine is also running a mongodb on port 27017.
- Docker encountered an exited while in use
- mongo in the container does not properly listen on IPv6
- custom mongod.conf file append to docker mongo it restarts HOT 1
- Operation not permitted\nActual exception type: std::system_error HOT 1
- security issues with stdlib HOT 2
- Is this a vulnerability? Under the set credentials, the client does not have credentials to connect but cannot operate HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongo.