I have a simple docker file, which has to create tables in DynamoDB:
FROM amazon/aws-cli AS seed
CMD ["dynamodb", "--endpoint-url", "http://dynamodb:8000", "create-table", "--table-name", "mytable", "--attribute-definitions", "AttributeName=user_id,AttributeType=N", "AttributeName=order_id,AttributeType=N", "--key-schema", "AttributeName=user_id,KeyType=HASH", "AttributeName=order_id,KeyType=RANGE", "--provisioned-throughput", "ReadCapacityUnits=5,WriteCapacityUnits=5", "--region", "eu-west-2"]
CMD ["dynamodb", "list-tables", "--endpoint-url", "http://dynamodb:8000"]
The output of the container is:
Run docker-compose -f my-compose.yaml up --abort-on-container-exit --force-recreate --remove-orphans my-container
Recreating dynamodb ...
Recreating my-container ... done
Attaching my-container
my-container | {
my-container | "TableNames": []
my-container | }
my-container exited with code 0
Aborting on container exit...
As you can see there's no any error from the table creation command, but the table list is empty after the creation. What am I doing wrong? Thanks in advance.