[英]dynamodb-admin not working with docker.compose.yml and localstack
This is my docker_compose:这是我的 docker_compose:
version: '3.7'
services:
app:
command: run
build:
context: .
dockerfile: Dockerfile.dev
image: test/testapi-configuration
ports:
- '5005:5005'
- '8080:8080'
volumes:
- './:/source:rw'
- '~/.vault_token:/root/.vault_token'
localstack:
image: localstack/localstack
ports:
- '4566:4566'
environment:
- SERVICES=dynamodb
- DEBUG=1
- DATA_DIR=/tmp/localstack/data
- DEFAULT_REGION=us-east-2
volumes:
- './.localstack:/tmp/localstack'
- '/var/run/docker.sock:/var/run/docker.sock'
My dockerfile.dev:我的 dockerfile.dev:
WORKDIR /source
ENTRYPOINT ["./gradlew"]
EXPOSE 5005
I set up my app running with:我设置我的应用程序运行:
localstack start
Then I run my api in the IntelliJ IDE, y create the table in the dynamoDb with:然后我在 IntelliJ IDE 中运行我的 api,然后在 dynamoDb 中创建表:
aws dynamodb --endpoint-url=http://localhost:4566 --region=us-east-2 create-table --cli-input-json file://file_example.json
But I cant get to use the dynamodb-admin tool working.但是我无法使用 dynamodb-admin 工具工作。 Docs here: https://www.npmjs.com/package/dynamodb-admin
文档在这里: https://www.npmjs.com/package/dynamodb-admin
I understand that I have to execute:我明白我必须执行:
DYNAMO_ENDPOINT=http://localhost:8080 dynamodb-admin -p 4566
But ive got following error:但是我遇到了以下错误:
UnknownError: 405
at Request.extractError (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/protocol/json.js:52:27)
at Request.callListeners (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/request.js:686:14)
at Request.transition (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/request.js:688:12)
at Request.callListeners (/usr/local/lib/node_modules/dynamodb-admin/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
The right way to do it was:正确的做法是:
docker-compose up localstack
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.