无法在特定字典上运行docker来持久化mongo

a7qyws3x  于 2021-07-13  发布在  Java
关注(0)|答案(0)|浏览(196)

我在Windows10中运行mongodb时遇到问题
我已经做了:
docker volume create--名称=mongodata
然后
docker运行-p 27017:27017-v mongodata:/data/db-d mongo
但我有个错误:

docker: Error response from daemon: invalid volume specification: 'mongodata:/data/db'.
See 'docker run --help'.

这样做:
docker运行-p 27017:27017-d mongo-v mongodata:\data\db

76abc6f334dae443621ce318bf704bf69816647a076f8987d27183f684109fc3
docker: Error response from daemon: container 76abc6f334dae443621ce318bf704bf69816647a076f8987d27183f684109fc3 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF621289F4B: (caller: 00007FF62123E13A) Exception(6) tid(3a8) 80070002 The system cannot find the file specified.
    CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
 Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"-v mongodata:\\data\\db","WorkingDirectory":"C:\\","Environment":{"MONGO_DOWNLOAD_SHA256":"1ef4f41cfaf3b91dc34543186b0b02ea2756075f4df822180b1fb46602604fd6","MONGO_DOWNLOAD_URL":"https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-4.4.5-signed.msi","MONGO_VERSION":"4.4.5"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}.

我也这样跑过:
docker运行-p 27017:27017-d mongo-v/d/opt/mongo:/data/db

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题