Skip to content
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

Support password file #35

Open
dazinator opened this issue Sep 9, 2022 · 0 comments
Open

Support password file #35

dazinator opened this issue Sep 9, 2022 · 0 comments

Comments

@dazinator
Copy link

At the moment the mysql password is read from an env variable MYSQL_ENV_MYSQL_PASSWORD

I'm not using the MYSQL_ENV_MYSQL_PASSWORD or MYSQL_ENV_MYSQL_ROOT_PASSWORD env vars for setting passwords, instead I am using the alternative environment variables that end _FILE and poiint to a locally mounted secret file containing the password instead for better security.

This is described here (excerpt below): https://hub.docker.com/_/mysql/

Docker Secrets
As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. For example:

$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql-root -d mysql:tag
Currently, this is only supported for MYSQL_ROOT_PASSWORD, MYSQL_ROOT_HOST, MYSQL_DATABASE, MYSQL_USER, and MYSQL_PASSWORD.

Would it be possible to add support for checking for these _FILE environment variables and if present, obtaining the the password from the file they point to instead - as this will then allow me to continue to use secrets, which I'd quite like to continue doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants