Currently files in /docker-entrypoint-initdb.d/ are executed on container start.
As far as I understand it the files are executed in no specific order.
If the line
for f in /docker-entrypoint-initdb.d/*; do
would be changed to
for f in``ls /docker-entrypoint-initdb.d/* | sort -V``; do
it would be possible to explicitly specify the order in which scripts are run.
They are in alphabetical order: http://serverfault.com/a/122743.
Thanks for the heads-up, I did not know that!
Maybe this should be mentioned in the docs... Let's see if I understand the instructions to update it... ;)
@jdoose I documented the order when this feature was added, but I didn't mention LC_COLLATE specifically and it could possibly be clearer.
@md5, I did not find anything in the readme. I submitted a pr with an updated content.m, I hope that's ok.
BTW, I would need some help understanding: There is also the mysql/mysql-server docker image (https://hub.docker.com/r/mysql/mysql-server/), forked from this repo. It is several commits ahead and several commits behind this one. The readme there does not mention the initdb-directory at all. What would be the correct way to update it there as well?
@jdoose I was confused with the postgres image where I did document the behavior. I wasn't directly involved in adding the initialization scripts to mysql.
Most helpful comment
They are in alphabetical order: http://serverfault.com/a/122743.