docker - docker run -v : [Errno 2] 没有这样的文件或目录
问题描述
我正在尝试运行
docker run --rm -v ~/.aws:/root/.aws \
-v $(pwd)/scripts:/root/scripts \
--link "${DYNAMO_CONTAINER}:localhost" \
amazon/aws-cli dynamodb batch-write-item \
--request-items file:///root/scripts/sampledata.json \
--endpoint-url http://localhost:8000
我得到的错误是
Error parsing parameter '--request-items': Unable to load paramfile file:///root/scripts/sampledata.json: [Errno 2] No such file or directory: '/root/scripts/sampledata.json'
我也试过
docker run --rm -v ~/.aws:/root/.aws \
-v $(pwd)/scripts:/root \
--link "${DYNAMO_CONTAINER}:localhost" \
amazon/aws-cli dynamodb batch-write-item \
--request-items file:///root/scripts/sampledata.json \
--endpoint-url http://localhost:8000
和
docker run --rm -v ~/.aws:/root/.aws \
-v $(pwd)/scripts:/root \
--link "${DYNAMO_CONTAINER}:localhost" \
amazon/aws-cli dynamodb batch-write-item \
--request-items file:///root/sampledata.json \
--endpoint-url http://localhost:8000
No such file...
在最后一个上,尽管路径不同,但我仍然遇到错误。
主机scripts
目录的结构是
scripts
├── sampledata.json
└── other.sh
我究竟做错了什么... ?
解决方案
推荐阅读
- android - 手机解锁时未调用Android NFC-HCE HostApduService
- sql - How can I find duplicate rows If I can't use ROW_NUMBER() in WHERE?
- android - 在不打开/关闭应用程序的情况下使用 ADB 运行 Espresso 测试?
- c# - How to check remotely if my .net console app is running by sending a request to it and getting a custom response from it
- javascript - Select and organize same columns from different tables
- vue.js - Vue - 如何识别 [__ob__: Observer]?
- python - Python console in Power BI
- sql - 使用顺序计数器创建动态列
- identityserver4 - Ubuntu 上 ASP.NET Core 和 IdentityServer4 的 SSL 异常
- jquery - D3 液体填充量表波形未更新