Docker mongodb share volume with mac os x

后端 未结 2 2091
没有蜡笔的小新
没有蜡笔的小新 2021-02-08 05:52

I try to use the mongodb official docker image on mac os x 10.10.2 with this command inside mac terminal :

docker run -v /Users/john/data/db:/data/db -p 27017:27         


        
2条回答
  •  一个人的身影
    2021-02-08 06:26

    It seems to be specific to the mongo software and the use of virtualbox , see the mongo docker README.

    WARNING (Windows & OS X): The default Docker setup on Windows and OS X uses a VirtualBox VM to host the Docker daemon. Unfortunately, the mechanism VirtualBox uses to share folders between the host system and the Docker container is not compatible with the memory mapped files used by MongoDB (see vbox bug, docs.mongodb.org and related jira.mongodb.org bug). This means that it is not possible to run a MongoDB container with the data directory mapped to the host.

    It doesn't behave like that if you keep the datadir out of the mounted volume.

提交回复
热议问题