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
网友评论