amazon/dynamodb-local Error: "Invalid directory for database creation"

0

While attempting to run this docker command docker run -p 8001:8001 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb -dbPath $DATA_DIRECTORY -cors http://localhost:5173,http://localhost:3000

I receive a Invalid directory for database creation. error. I run the command above from a bash script:

DATA_DIRECTORY=$(realpath data)
docker run -p 8001:8001 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb -dbPath $DATA_DIRECTORY -cors http://localhost:5173,http://localhost:3000

When I inspect the docker container I can see that the args passed are correct and the folder does exist. Not sure what I am doing wrong here. Enter image description here

Darrell
已提问 4 个月前273 查看次数
1 回答
0

The -dbPath specifies the path in the container. Therefore, if you want to create it in a folder on your computer, you must share it with the container using the `-v' option.

For example, you can run the following.

docker run -p 8001:8001 -v $DATA_DIRECTORY:/home/dynamodblocal amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb -dbPath . -cors http://localhost:5173,http://localhost:3000
profile picture
专家
shibata
已回答 4 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则