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
gefragt vor 4 Monaten273 Aufrufe
1 Antwort
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
EXPERTE
shibata
beantwortet vor 4 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen