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

Implement the docker-entrypoint-initdb.d feature from MySql & Mariadb #16

Closed cpjolly closed 7 years ago

cpjolly commented 7 years ago

The /usr/local/lib/startup.sh feature is useful but does not enable additional SQL commands to be executed during the initialisation of the cluster, for example to create additional databases or users.

The latest MySql and MarianDb Docker images both look for additional configuration scripts of various types in the docker-entrypoint-initdb.d folder. For example, the contents of any *.sql files are appended to the list of SQL commands to be executed during initialisation.

If this feature was copied, it would enable a wide variety of additional configuration customisations.

colinmollenhour commented 7 years ago

It looks like they've made quite a few improvements. I'm not sure if these all translate 100% to Galera such as starting the server only on a Unix socket without some modifications (e.g. Galera would probably need to be explicitly disabled in via command line option to run scripts then shut down again). I'm open to merging any improvements you want to contribute but I probably won't be making any significant changes myself any time soon as time just does not permit currently. Thanks!

cpjolly commented 7 years ago

I've added a pull request that adds this feature to start.sh.