Closed cpjolly closed 7 years ago
No objection. Pull Request? :)
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.
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