mac Docker mongo

2019-06-12  本文已影响0人  小野鬼3797

mac按照教程用docker按照MongoDB时报错:

docker run --name mongo2 -p 27017:27017 -v ${HOME}/docker-data/mongo/:/data/db -d mongo

err: the path /docker-data/mongo/ is not shared from OS X and is not known to Docker.You can configure shared paths from Docker -> Preferences... -> File Sharing.

先停止错误运行的docker image: docker stop 容器ID或容器名 

重新启动:docker run --name mongo2 -p 27017:27017 -v ${HOME}/docker-data/mongo/:/data/db -d mongo

进入mongo:docker exec -it mongo2 bash

上一篇下一篇

猜你喜欢

热点阅读