Mysql: initdb: Execute files in deterministic order

Created on 27 Jul 2016  路  5Comments  路  Source: docker-library/mysql

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.

Most helpful comment

They are in alphabetical order: http://serverfault.com/a/122743.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EnziinSystem picture EnziinSystem  路  3Comments

mcandre picture mcandre  路  4Comments

seangerhardt-wf picture seangerhardt-wf  路  4Comments

bscheshirwork picture bscheshirwork  路  5Comments

TheNotary picture TheNotary  路  4Comments