-
Notifications
You must be signed in to change notification settings - Fork 380
Support the use of docker secrets for the database password #149
Comments
Sounds like a good idea. We'd have to support some other secrets as well, AWS credentials at the very least. Not sure how well used docker secrets are vs other ways of providing credentials in a more secure manner. |
Actually, "official" Docker library images make the difference between the "raw" variable and the one coming from a (secret) file. They seem to use the convention of environment variables ending with |
This feature would be appreciated. At the moment i have made this workaround, but something more generic would be great. #!/usr/bin/env bash
# Docker secrets support
if [ -f /run/secrets/GRAFANA_USER ]; then
export GF_SECURITY_ADMIN_USER=$(< /run/secrets/GRAFANA_USER)
fi
if [ -f /run/secrets/GRAFANA_PASSWORD ]; then
export GF_SECURITY_ADMIN_PASSWORD=$(< /run/secrets/GRAFANA_PASSWORD)
fi
/run.sh |
I also use a workaround, though all credit must go to the authors of this article. Added generic
Added new
Include additional secret and env flags in
|
Hi,
Docker secrets allows to make secrets available in the container as files.
Environment variables are not supported.
Would it be possible to support setting the environment variable for the database password from a file like this is done in the postgres official container in docker-entrypoint.sh
In the postgres container, the POSTGRES_PASSWORD environment variable in the compose file can contain either the password itself or the path to the secrets file (eg: /run/secrets/postgres_password)
The text was updated successfully, but these errors were encountered: