Hi did anyone try to dockerize spicedb
# spicedb
n
Hi, did anyone try to dockerize spicedb to run locally? Can you guy help me with loading configs and shema to this container?
v
SpiceDB is already offered as a container, you can find the links to the various container registries supported in the release notes
n
yes, I found it's docker image in docker hub, but I can't find the instructions to set up it, like create load schema
one more thing, do I need a postgre container to store data for spice db, or it already attached inside spicedb?
v
There are instructions at https://authzed.com/docs/spicedb/installing you need a posrgres (or any of the other supported databases) to store data, yes. If you are just testing SpiceDB, you can use the "memory" datastore implementation
n
I saw this document, but I don't find the section talking about loading schema
can you help me by highlighting it?
v
You can either bootstrap a SpiceDB with a schema (and even relationships) from a playground export yaml (play.authzed.com), or you can perform a
WriteSchema
API call. So it depends on your needs. - if you want to bootstrap, you need to mount the YAML into the container, and pass the path to that YAML to the
--datastore-bootstrap-files
command. - if you want to write the schema in runtime, you can use
zed
CLI. e.g. if you are exposing the container ports to your host machine, you could do
Copy code
zed context set my-context localhost:50051 <my-preshared-key>
zed schema write <my_schema_file>
maybe this documentation example may also help: https://authzed.com/docs/guides/first-app
n
Oh, that great, thanks for your helps
Hmm @vroldanbet, one question, how can I get the token to connect to spice db
v
The token is a parameter you set in your SpiceDB container via
--grpc-preshared-key <your_key_here>
n
ya, thank you. thanks a lot
Hi @vroldanbet, is there anyway to change the entrypoint of the image? With tag
latest-debug
, it can be changed easily, but with
latest
tag, I always get
file not found error
. Have you ever deal with it? Is there any solutions?
v
you cannot do this with the base default image, you need a variant that inludex busybox:
Copy code
docker run -ti --entrypoint=/bin/sh authzed/spicedb:latest-debug
`
10 Views