linux - aws cli 无法从 dynamodb docker 容器读取

标签 linux amazon-web-services docker amazon-dynamodb

我正在 Docker 容器上运行 dynamodb,并且能够使用 python boto3 写入表,这一切都很好。

现在,当我使用 aws CLI 从容器外部查询 dynamodb 表时,它会给出此错误并且找不到该表

╰─➤  aws dynamodb --region=eu-west-1 --endpoint-url http://localhost:8000  scan --table-name devApiConfig

A client error (ResourceNotFoundException) occurred when calling the Scan operation: Cannot do operations on a non-existent table

dynamodb docker容器创建的sqlite数据库的名称是

localaccesskey_eu-west-1.db


aws --region=eu-west-1 dynamodb list-tables --endpoint-url http://localhost:8000                                                                                                                                     
{
    "TableNames": []
}

任何想法或提示,因为当从 Boto3 使用时,dynamodb 上确实存在这些表....?

最佳答案

我在另一个问题里已经回答过这个问题: https://stackoverflow.com/a/40806393/1061798

检查您的 docker 如何启动 Dyanmo。如果您使用 deangiberson/aws-dynamodb-local(就像我一样),那么您将需要更改启动参数以添加 -sharedDb。修改 Dockerfile 或按如下方式运行:

docker run -p 8000:8000 -d -it deangiberson/aws-dynamodb-local "-sharedDb"

我还没有测试过,所以如果这不起作用请告诉我,但希望你能明白。

关于linux - aws cli 无法从 dynamodb docker 容器读取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38377852/

相关文章:

node.js - Gatsby 在 mozjpeg 上构建失败

python-3.x - 使用 Python 3.6 和密码学模块部署 AWS Lambda 包

amazon-web-services - AWS DynamoDB 查询和排序

javascript - AWS Lambda 无法连接到 RDS 实例,但我可以在本地连接?

elasticsearch - Fluentd - 使用源标签作为索引

javascript - 在 Node js 中创建文本文件时出现错误 : ENOENT: no such file or directory, 打开错误

linux - 不要删除 root 用户在其他用户文件夹中创建的文件

linux - 在 sed 命令中扩展 unix 变量

linux - OpenFirmware 接口(interface)的用途是什么

php - 无法在Laradock中安装php7.2-ldap扩展