-
What Grafana version and what operating system are you using?
Docker Version → 24.0.2
Docker-compose → 1.29.2
Ubuntu 22.04 -
What are you trying to achieve?
I’m trying to use docker swarm secrets to securely configure credentials for my grafana using this variable - GF_SECURITY_ADMIN_PASSWORD_FILE=/run/secrets/password.pwd
To achieve this I’m following this guide
Docker Secrets in Grafana | DIT -
How are you trying to achieve it?
- I setup a docker swarm
- I created a secret using this command echo “mypassword” | docker secret create password.pwd -
- I configured my docker-compose.yml to use the secret created in step 2
- I deploy my stack using: docker stack deploy -c docker-compose.yml stack_name
- What happened?
- The stack start but it not take the password define in the secret (it still use the default “admin” password
- If I connect to my docker using docker exec -it xxxxxxxxx bash I can see the expected password with cat /run/secrets/password.pwd
- What did you expect to happen?
- I expected that the grafana take the enviroment - GF_SECURITY_ADMIN_PASSWORD_FILE=/run/secrets/password.pwd
(If I use - GF_SECURITY_ADMIN_PASSWORD=mypassword it works)
- Can you copy/paste the configuration(s) that you are having problems with?
version: “3.9”
networks:
grafana_net:
name: grafana_net
external: true
internal_net:
name: internal_test
services:
grafana:
image: grafana/grafana:latest
volumes:
- grafanadata:/var/lib/grafana
- ./grafana.ini:/etc/grafana/grafana.ini
environment:
- GF_SECURITY_ADMIN_PASSWORD_FILE=/run/secrets/password.pwd
networks:
- grafana_net
- internal_net
secrets:
-
source: password.pwd
target: /run/secrets/password.pwd
mode: 0444
secrets:
password.pwd:
external: true
volumes:
grafanadata: {}
-
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
N/A -
Did you follow any online instructions? If so, what is the URL?
Docker Secrets in Grafana | DIT