spannerbox
is a set of tools to work with Spanner locally, distributed as docker image.
WARNING!!
spannerbox
MUST NOT be used in production.
emulator
spanner-cli
spanner-dump
spanner-truncate
The following environment variables can be used to customize spannerbox
container:
SPANNER_PROJECT_ID
: Google project ID (default totest-project
)SPANNER_INSTANCE_ID
: Spanner instance ID (default totest-instance
)SPANNER_DATABASE_ID
: Spanner Database ID (default totest-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
- emulator-samples for the inspiration
- spanner-cli
- spanner-dump
- spanner-truncate
This is not an official Google product.