Answer a question

I'm new to containers and docker, so bear with me. I'm trying to get mongo up and running on a Synology NAS where the db files are stored in a share folder (different than the docker folder created). All users have full read/write access but the following error keeps coming up.

STORAGE [initandlisten] exception in initAndListen std ::exception:boost::filesystem::status: Permission denied: "/data/db/storage.bson", terminating

Mongo Error

This is how I have the container folder structure set up. I think the issue is a result of the virtual drive mapping, but I'm not sure. As always, any help would be greatly appreciated. Drive Mapping

EDIT: Adding the permissions for /share/data/db below.

Folder permissions

Answers

Adding answer from comment for posterity...

This issue stems from the MongoDB process inside the Docker container running as a user that does not have permissions on the host machine. The easiest, but perhaps least secure fix is to mark the host volume with read and write permissions for everyone (chmod 777).

Check out this post for more details and more "proper" solutions. What is the (best) way to manage permissions for docker shared volumes

Logo

MongoDB社区为您提供最前沿的新闻资讯和知识内容

更多推荐