2

I'm trying to install dynamodb locally for docker.

I've written the below code from here.

docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedD

Then I can reach localhost:8000/shell

In my client java, I set the endpoint

AmazonDynamoDB client = AmazonDynamoDBClientBuilder
    .standard()
    .withCredentials(new EnvironmentVariableCredentialsProvider())
    .withEndpointConfiguration(
        new AwsClientBuilder.EndpointConfiguration("http://localhost:8000/", "eu-central-1")
    ).build();

but when I run it, log the following error.

Can anyone help me? enter code here

SuperStar518
  • 2,814
  • 2
  • 20
  • 35
user11475921
  • 31
  • 1
  • 4

1 Answers1

4

Replace your endpoint configuration from:

http://localhost:8000

To:

http://host.docker.internal:8000
4b0
  • 21,981
  • 30
  • 95
  • 142
  • It only works on Mac. On Linux this http://host.docker.internal:8000 is not reachable and requires extra steps https://medium.com/@TimvanBaarsen/how-to-connect-to-the-docker-host-from-inside-a-docker-container-112b4c71bc66 – user1278890 Sep 22 '21 at 15:43