Configure Grafana using Docker secrets

I would like to use Example 3 from

My docker-compose file has grafana service:

    image: grafana/grafana-oss:10.2.0-ubuntu
      GF_USERS_HOME_PAGE: /dashboards/f/1/
      GF_SECURITY_ADMIN_PASSWORD: /run/secrets/grafana_password
      - grafana_password
    external: true
    name: "${GRAFANA_PASSWORD:?err}"

I tried to set GRAFANA_PASSWORD first and then ran docker-compose file.
Command used: GRAFANA_PASSWORD= bike docker-compose up -d.

However it does not let me login with bike password. Please brief me with docker secrets using name. And how to use it with GF_SECURITY_ADMIN_PASSWORD.

Thank you.

Thanks but I have already checked it. It does not give clear idea on how to use example 3 from Secrets top-level element | Docker Docs in the docker-compose file I have mentioned earlier.

OK, try to run container manually and debug what and how it is processed in

Eventually, modify to be able to use also this kind of secret and overwrite default

You also don’t follow Grafana doc: GF_SECURITY_ADMIN_PASSWORD__FILE (doc) vs GF_SECURITY_ADMIN_PASSWORD (you)