Skip to content

spannerbox is a set of tools to work with Spanner emulator

License

Notifications You must be signed in to change notification settings

iromli/docker-spannerbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spannerbox

spannerbox is a set of tools to work with Spanner locally, distributed as docker image.

WARNING!!

spannerbox MUST NOT be used in production.

Batteries Included

  • emulator
  • spanner-cli
  • spanner-dump
  • spanner-truncate

Usage

The following environment variables can be used to customize spannerbox container:

  • SPANNER_PROJECT_ID: Google project ID (default to test-project)
  • SPANNER_INSTANCE_ID: Spanner instance ID (default to test-instance)
  • SPANNER_DATABASE_ID: Spanner Database ID (default to test-database)

Example of running spannerbox using docker:

export SPANNER_PROJECT_ID=test-project
export SPANNER_INSTANCE_ID=test-instance
export SPANNER_DATABASE_ID=test-database

docker run \
    -p 9010:9010 \
    --name spanner \
    -e SPANNER_PROJECT_ID=$SPANNER_PROJECT_ID \
    -e SPANNER_INSTANCE_ID=$SPANNER_INSTANCE_ID \
    -e SPANNER_DATABASE_ID=$SPANNER_DATABASE_ID \
    iromli/spannerbox:$VERSION emulator
NOTE about $VERSION

See Releases for available $VERSION. The v prefix must be omitted when using tag, for example: spannerbox:1.0.0 instead of spannerbox:v1.0.0.

The database can be accessed using command as seen below:

docker exec -ti spanner spanner-cli

Credits

Disclaimer

This is not an official Google product.