docker run -v : [Errno 2] 没有那个文件或目录

时间:2021-06-09 21:34:42

标签: docker docker-volume

我正在尝试跑步

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

我做错了什么...?

0 个答案:

没有答案