docker-bigtable icon indicating copy to clipboard operation
docker-bigtable copied to clipboard

gcloud emulator docs

Open garye opened this issue 8 years ago • 3 comments

Just a note that the emulator is available through gcloud, as well, and the emulator is documented here: https://cloud.google.com/bigtable/docs/emulator

garye avatar Jan 27 '17 17:01 garye

Nice, I will add a link in the README. A docker version is still useful for portability and integration testing. But it would actually be better to just run the emulator inside the docker container instead of the go stuff directly. Only issue would be figuring out which port its listening on.

rgruener avatar Jan 27 '17 21:01 rgruener

You can specify the port with the gcloud command: https://cloud.google.com/sdk/gcloud/reference/beta/emulators/bigtable/start

garye avatar Jan 27 '17 21:01 garye

It turns out that you can run the bigtable emulator from google's cloud-sdk docker image

docker run -p 127.0.0.1:8086:8086 --rm -ti google/cloud-sdk gcloud beta emulators bigtable start --host-port=0.0.0.0:8086
Executing: /google-cloud-sdk/platform/bigtable-emulator/cbtemulator --host=0.0.0.0 --port=8086
[bigtable] Cloud Bigtable emulator running on [::]:8086

in a different shell (with the cbt tool installed):

export BIGTABLE_EMULATOR_HOST=localhost:8086

cbt -project foo -instance bar createtable foobar
2017/06/14 16:24:15 -creds flag unset, will use gcloud credential

cbt -project foo -instance bar ls
2017/06/14 16:24:17 -creds flag unset, will use gcloud credential
foobar

Hope that's useful :)

yusefnapora avatar Jun 14 '17 20:06 yusefnapora