-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Container: Passwort file as source of the mongodb passwort #380
Comments
Hi @Andy-Voigt, |
Hello @denisok, Docker mounts secrets (passwords) under /tmp/SECRET_NAME as plain text file. This is done to keep the envoriment variables free from passwords. If we cannot use this mechanism we have to write the mongodb password to our compose file. Is there a other way to keep the docker compose file free of passwords? |
@Andy-Voigt One way you can solve this is to do it as it's done in the Grafana docker image, they have a shell script as an entrypoint and that script contains this, https://github.com/grafana/grafana/blob/f5641c0293e5c2218b1e2506e433df51390ff63f/packaging/docker/run.sh#L49-L63 Then you can pass the path to the secret as an environment variable. |
Thanks for your replay. Thats pretty close to what we have done today. We "fork" the original Docker image and copy the mongodb_exporter to an ubuntu image. With that we create a bash script that fetch a config file from our spring config server and grep out the URL, password and username for mongodb. Now we can run that "sidecar" as normal service in our swarm. But it would be much simpler if we can use a docker secrete. |
OK, now I got it. make sense now to add both env and read from file options to mongodb_exporter so it could pick up secrets and maybe also config from file or from the env vars. |
I want to add a bit more clarification around this issue as I find it a useful method to support the authentication process. For mongo, one can start it like
It would be similarly useful to allow to pass to the container environmental vars: |
user and pass are in #560 . FILEs are still missed |
Are there any news on that? Would it be possible to address multiple db instances with using a single secret? |
Hello,
it would be relay helpful if the docker container can read a password file as source of the mongodb password.
The text was updated successfully, but these errors were encountered: