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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인