Install Docker and Docker Compose environments
apt install docker
apt install docker compose
create profile
vi docker-compose.yml
The file content is as follows
version: '3.8'
services:
dynamodb-local:
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ./data"
image: "amazon/dynamodb-local:latest"
container_name: dynamodb-local
ports:
- "8000:8000"
volumes:
- "./docker/dynamodb:/home/dynamodblocal/data"
working_dir: /home/dynamodblocal
Start Service
docker-compose up -d
If an error is reported: prompt for version mismatch
modify
Version: '3.8'
by
Version: '3.3'
Start again to view the logs:
docker logs -f dynamodb-local
If an error is reported:
SEVERE: [sqlite] SQLiteQueue [shared local instance. db]: error running job queue
Com. almworks. sqlite4java. SQLiteException: [14] cannot open database file
At com. almworks. sqlite4java. SQLiteConnection. open0 (SQLiteConnection. java: 1480)
At com. almworks. sqlite4java. SQLiteConnection. open (SQLiteConnection. java: 282)
At com. almworks. sqlite4java. SQLiteConnection. open (SQLiteConnection. java: 293)
At com. almworks. sqlite4java. SQLiteQueue. openConnection (SQLiteQueue. java: 464)
At com. almworks. sqlite4java. SQLiteQueue. queueFunction (SQLiteQueue. java: 641)
At com. almworks. sqlite4java. SQLiteQueue. runQueue (SQLiteQueue. java: 623)
At com. almworks. sqlite4java. SQLiteQueue. access $000 (SQLiteQueue. java: 77)
At com. almworks. sqlite4java. SQLiteQueue $1. run (SQLiteQueue. java: 205)
At java. base/java. lang. Thread. run (Thread. java: 829)
Add at the bottom of the configuration file
user: root
Final configuration:
version: '3.3'
services:
dynamodb-local:
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ./data"
image: "amazon/dynamodb-local:latest"
container_name: dynamodb-local
ports:
- "8000:8000"
volumes:
- "./docker/dynamodb:/home/dynamodblocal/data"
working_dir: /home/dynamodblocal
user: root
Top comments (0)