fradelg / docker-mysql-cron-backup

Docker image to backup all your databases periodically
Apache License 2.0
305 stars 111 forks source link

using secrets #23

Closed judos closed 2 years ago

judos commented 5 years ago

Hi there, I like your docker image because it's very easy to use and phpmyadmin supports the .sql.gz by default.

Does the image support secret to set the db password?

fradelg commented 5 years ago

Hi,

thanks for using this image!

Regarding secrets I am not totally sure what you mean. You can always pass the credentials using environment variables in your session:

export MYSQL_PASS=<secret>
docker run -e MYSQL_PASS fradelg/docker-mysql-cron-backup

If you want to use docker secrets, you can overwrite the entrypoint of the image with your own shell script to read those secrets in an environment variable. Take a look at this answer in StackOverflow:

https://stackoverflow.com/questions/48094850/docker-stack-setting-environment-variable-from-secrets

I hope it helps you