Configure Grafana Docker deployment with custom Dockerfile

Hi, I’m trying to configure the Grafana Docker container to use custom dashboards for example. I’d like to do that not by passing environmental variables when calling “docker run” but file based, e.g., in a Dockerfile.

I read the docs on how to deploy Grafana using Docker, how to configure it, and about provisioning, but I can’t map the this read there to my Docker deployment.
I’m quite new to Docker and I don’t know what’s the best way to go here. Should I setup a Dockerfile using Grafana as base image and then copying a custom Dashboard JSON inside the Docker when building it? Where to/how?

Sorry, for asking rookie questions, but I’ve been searching and trying for quite a while and I’m not moving forward…

I found that using an external database solves this. Apparently, users and dashboards are all stored in the DB. It would be nice if the documentation were helpful with basic questions like this.