Open garye opened 7 years ago
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.
You can specify the port with the gcloud command: https://cloud.google.com/sdk/gcloud/reference/beta/emulators/bigtable/start
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 :)
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