Code Monkey home page Code Monkey logo

docker-dynamodb-local's Introduction

docker-dynamodb-local

This is the Git repo of the Docker image for Amazon DynamoDB Local.

Supported tags and respective Dockerfile links

What is Amazon DynamoDB Local?

Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale. It is a fully managed cloud database and supports both document and key-value store models.

The Amazon DynamoDB Local (downloadable version of DynamoDB) lets you write applications without accessing the actual Amazon DynamoDB web service. Instead, the database is self-contained on your computer.

How to use this image?

Start a DynamoDB Local instance

$ docker run -v "$PWD":/dynamodb_local_db -p 8000:8000 cnadiminti/dynamodb-local:latest
Initializing DynamoDB Local with the following configuration:
Port:	8000
InMemory:	false
DbPath:	/dynamodb_local_db
SharedDb:	true
shouldDelayTransientStatuses:	false
CorsParams:	*

This will add your current directory as a volume to the container and publish host port to container port.

Verify the DynamoDB Local instance with AWS CLI

Create a Table

$ aws dynamodb create-table --table-name myTable --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 --endpoint-url http://0.0.0.0:8000

List the Tables

$ aws dynamodb list-tables --endpoint-url http://0.0.0.0:8000 --output json
{
    "TableNames": [
        "myTable"
    ]
}

For complete list of available commands please refer AWS DynamoDB CLI.

Environment Variables

JAVA_OPTS

This optional environment variable can be used to set JVM options.

Example usage: docker run -v "$PWD":/dynamodb_local_db -p 8000:8000 -e JAVA_OPTS='-Xmx256m' cnadiminti/dynamodb-local:latest

DYNAMODB_PORT

This optional environment variable can be used to overwrite the default port (8000).

Example usage: docker run -v "$PWD":/dynamodb_local_db -e DYNAMODB_PORT=443 -p 8000:443 cnadiminti/dynamodb-local:latest

License

Alternatives

User Feedback

Issues

If you have any problems with or questions about this image, please contact us through a GitHub issue.

Contributing

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

docker-dynamodb-local's People

Contributors

cnadiminti avatar saawan avatar veqryn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-dynamodb-local's Issues

Connection Refused for DynamoDB

Hello,
I am trying to create a docker container to run local python tests.
The code is used to test functionality that depends on MYSQL, Redis and DynamoDB
This is my docker-compose file.

version: '3'
services:
  app:
    build: .
    environment:
      - DATABASE_HOST=database
      - DATABASE_USERNAME=foo
      - DATABASE_PASSWORD=bar
      - CACHE_HOST=cache
      - BUGSNAG_API_KEY=key
      - DYNAMODB_URL='http://localhost:8000/'
    depends_on:
      - database
      - cache
      - dynamoDB
  database:
    image: "mariadb:10.0.24"
    environment:
      - MYSQL_DATABASE=database
      - MYSQL_USER=foo
      - MYSQL_PASSWORD=bar
      - MYSQL_ROOT_PASSWORD=bar
  cache:
    image: "redis:3.2"
  dynamoDB:
    image: cnadiminti/dynamodb-local:latest
    command: -inMemory
    ports:
      - '8000:8000'

I am keeping on Getting Connection refused with the following error message
`DEBUG:botocore.auth:CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.0
host:localhost:8000
x-amz-date:20171023T005945Z
x-amz-target:DynamoDB_20120810.CreateTable

content-type;host;x-amz-date;x-amz-target
09548050458cafc204a942a4de3da965dcadfa2e320004b6727fc7f8cb86cb93
DEBUG:botocore.auth:StringToSign:
AWS4-HMAC-SHA256
20171023T005945Z
20171023/ap-southeast-2/dynamodb/aws4_request
679032bcc6577cddc2eceb7175969a905fd94b15220fe83eb3da2c24839938c7
DEBUG:botocore.auth:Signature:
aa01cbb5a15840e8dae2ba425b065f60f48db5251919641ff03510f52a5467b8
DEBUG:botocore.endpoint:Sending http request: <PreparedRequest [POST]>
INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): localhost
DEBUG:botocore.endpoint:ConnectionError received when sending HTTP request.
`

Recent Breaking Change - EXPOSE 8000/Publish-all

This is more for informational purposes for others, but there was a recent breaking change here that I don't think was intended to be a breaking change. For consumers of this image that use docker run's --publish-all/-P option, port 8000 is no longer published with the latest changes. The port has to be explicitly published now, instead of relying on the default EXPOSE port.

Limit java heap size

Currently after just a few interactions with local DynamoDB its java process' memory usage becomes ~2GiB. It looks like a serious waste of memory for a SQLite wrapper. There are two options:

  1. Set reasonable default, e.g. -Xmx256m works fine
  2. Provide a way for override java config through passing an environment variable to the container

Add inMemory option

Could you expose an environment variable whereby we can indicate that we want inMemory only?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.