MongoDB 无法从 boot2docker 写入 docker 中的本地数据库

MongoDB is unable to write to a local database in docker from boot2docker

基本上我想运行 meteor in a ubuntu docker on os x,并使用atom编辑源代码。所以我使用共享卷来实现这个。

我使用 virtualbox 4.3.30 和 boot2docker 1.71.

Meteor 应用程序 运行 在不在共享卷中时运行良好。 但是如果我把它放在共享卷中,它会说:

Unexpected mongo exit code 100. Restarting.   
Unexpected mongo exit code 100. Restarting.   
Unexpected mongo exit code 100. Restarting.   
Can't start Mongo server.                     
MongoDB had an unspecified uncaught exception.
This can be caused by MongoDB being unable to write to a local database.
Check that you have permissions to write to .meteor/local. MongoDB does
not support filesystems like NFS that do not allow file locking.

我用来 运行 docker 的命令是

docker run -t -i -p 3000:3000 -v ~/Documents/myapp:/home/myapp -d ubuntu

我的问题是如何在共享卷中成功安装 meteor 应用 运行 mongodb?


我已经尝试 'meteor reset' 并删除了 .meteor 中的锁定文件,其中 none 有效。

问题是 mongodb 不支持共享 NFS 文件类型。 boot2docker 使用 NFS。你可以尝试使用虚拟盒子文件的分享,说明在https://github.com/boot2docker/boot2docker#virtualbox-guest-additions.

另一种选择是使用 azk,它是核心团队的一部分。 注意:目前只有 Mac OS X 和 Linux