colinmollenhour / mariadb-galera-swarm

MariaDb Galera Cluster container based on official mariadb image which can auto-bootstrap and recover cluster state.
https://hub.docker.com/r/colinmollenhour/mariadb-galera-swarm
Apache License 2.0
217 stars 102 forks source link

Consistent use of *_FILE in start.sh would be useful #15

Closed cpjolly closed 7 years ago

cpjolly commented 7 years ago

The use of *_FILE variables in start.sh to allow for docker secrets is super-useful.

However, it would be even more useful if this was possible for all environment variables used in the script. For example, right now this is not possible for MYSQL_USER.

Perhaps the method used by the latest mariadb:10.1 and wordpress docker-entrypoint.sh scripts could be adopted ? They add a function called file_env() at the top of the file, to allow any environment variable to be read in from a file.

https://github.com/docker-library/mariadb/blob/master/10.1/docker-entrypoint.sh

https://github.com/docker-library/wordpress/blob/3a1ca61731e6070764d5b7235e3b6617798b8af8/php5.6/apache/docker-entrypoint.sh

colinmollenhour commented 7 years ago

No objection. Pull Request? :)

cpjolly commented 7 years ago

Actually, this is a more significant change because of the way start.sh reads the default secret locations for MYSQL_ROOT_PASSWORD_FILE etc. I think the benefit probably doesn't justify the effort at the moment, so I'm closing this for now.