我正在使用docker,我试图运行命令
docker run -i --rm -v $PWD/rentit.md:/usr/src/app/api.md -p 3000:3000 ajnasz/api-mock
我的意思是将主机 $PWD
的当前目录映射到虚拟机中的/usr/src/app/api.md
之类的路径。
我确信,在我目前的路径中,我有rentit.md
文件
但该命令的输出是以下错误:
npm info it worked if it ends with ok
npm info using npm@2.14.12
npm info using node@v4.3.1
npm info prestart apimock@1.0.0
npm info start apimock@1.0.0
> apimock@1.0.0 start /usr/src/app
> $(npm bin)/api-mock api.md
npm info it worked if it ends with ok
npm info using npm@2.14.12
npm info using node@v4.3.1
npm info ok
info: Enabled Cross-Origin-Resource-Sharing (CORS)
info: Allow-Origin: *
info: Allow-Methods: GET, PUT, POST, PATCH, DELETE, TRACE, OPTIONS
info: Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization, Referer, Prefer
error: Error: EISDIR: illegal operation on a directory, read
Error: EISDIR: illegal operation on a directory, read
at Error (native)
at Object.fs.readSync (fs.js:603:19)
at Object.fs.readFileSync (fs.js:438:24)
at ApiMock.run (/usr/src/app/node_modules/api-mock/lib/api-mock.js:51:17)
at Object.<anonymous> (/usr/src/app/node_modules/api-mock/bin/api-mock:107:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
npm info apimock@1.0.0 Failed to exec start script
npm ERR! Linux 4.1.19-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.3.1
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! apimock@1.0.0 start: `$(npm bin)/api-mock api.md`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the apimock@1.0.0 start script '$(npm bin)/api-mock api.md'.
npm ERR! This is most likely a problem with the apimock package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! $(npm bin)/api-mock api.md
npm ERR! You can get their info via:
npm ERR! npm owner ls apimock
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/app/npm-debug.log
问题是路径$PWD/rentit.md
是否提到了我的泊坞终端的当前目录?
我该如何解决问题?