https://cerbos.dev logo
Title
d

Dipesh Bajgain

03/23/2023, 7:54 AM
Hello everyone, I am trying to create a cerbos docker image and I get the error as
{"log.level":"error","@timestamp":"2023-03-23T07:50:37.865Z","log.logger":"cerbos.index","message":"Index build failed","load_failures":[{"file":"config.yaml","error":"failed to unmarshal JSON: proto: (line 1:2): unknown field \"server\""}]}
cerbos: error: failed to create store: failed to build index: missing imports=0, missing scopes=0, duplicate definitions=0, load failures=1
My docker compose config is as below:
version: "3.8"

services:
  app:
    restart: always
    container_name: dashboard
    image: dashboard
    build:
      context: .
      target: development
    volumes:
      - ./src:/app/src
    ports:
      - 3000:3000
    command: npm run dev

  cerbos:
    image: <http://ghcr.io/cerbos/cerbos:0.25.0|ghcr.io/cerbos/cerbos:0.25.0>
    container_name: cerbos
    volumes:
      - ./cerbos:/config
      - ./cerbos:/policies
    ports:
      - "3592:3592"
      - "3593:3593"
    restart: unless-stopped
    command: server --config /config/config.yaml
And my cerbos config file is as below:
server:
  playgroundEnabled: true
  httpListenAddr: ":3592"
  grpcListenAddr: ":3593"

storage:
  driver: "disk"
  disk:
    directory: /policies
    watchForChanges: true
a

Alex Olivier (Cerbos)

03/23/2023, 2:13 PM
Hey, This happens when the config.yaml is in the same path as your policies. To resolve this, move your policy files into a subfolder then mount that in the
/policies
path
d

Dipesh Bajgain

03/24/2023, 3:21 AM
Thank you @Alex Olivier (Cerbos) for your help.