-
Notifications
You must be signed in to change notification settings - Fork 443
DB Connection failed #80
Comments
For Windows and Mac OSX you might run into problems with the docker-compose.yml in this repo as it mounts a folder from the host system. Please see https://hub.docker.com/_/mongo -> Scroll down to Caveats -> Where to Store Data But that should not explain the error on Linux. Maybe more of the logs can help. |
Exact same error on Window 10. At the moment just for testing I have disabled |
@MatteoGioioso with the link I was specifically referring to the mentioned caveats section in the mongodb container documentation. On Windows and Mac OSX you cannot use folders mounted from the host to store data for mongodb, which is currently the case with the Docker compose file provided in this repository. You will have to use Docker volumes if you wish to persist the data for longer usage, otherwise you might lose any data stored in the mongodb container when you remove it (e.g. for updating to a new version). |
@msgeissler Sorry if I still did not get it.
just
Thanks |
@MatteoGioioso you should read the storage overview of docker to get a basic knowledge of the different types of storage docker has: https://docs.docker.com/storage/ For mongodb (and this applies to other containers as well, mainly databases) bind mounts on Windows and OS X are not support. From the mongo docker page:
(The VirtualBox VM part, as far as I know, is outdated. At least on Windows it uses Hyper-V, but basically still an additional layer of virtualisation) As you already mentioned, you need docker volumes for mongodb on these operating systems. I would suggest you use |
To be clear, I already removed the volumes from my compose file, because I know on Windows the paths will be different and I just wanted to get the compose stack running for once, before deciding where to persist the data. So the mounts are not the problem I had, me thinks. |
@batjko hmmm, the best I can find on this still relates to a permission problem with mounting host volumes on Windows: docker-library/mongo#74 I am not sure what is going on in your case, but it looks like this is more related to docker and mongo. This may sound a bit counter intuitive, but could you try it again with an explicitly defined / named volume? |
Here's what worked for me: Add a volume for MongoDB:
Reference it in the db section:
|
Why is this closed when it is not fixed? A new user like me wanted to try out strapi - is going away after it isn't working with a simple docker .... |
It seems that he hasn't made a pull request. Maybe you could make one. This should be a quick one. |
For mongodb (and this applies to other containers as well, mainly databases) bind mounts on Windows and OS X are not support. So to Fix strapi#80 we move its data into its own volume
Today I got this repository and ran
docker-compose up
. This is the (wrong) output? Any way to fix this?The text was updated successfully, but these errors were encountered: