-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add support for "/docker-entrypoint-initdb.d" similar to PostgreSQL's implementation #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for "/docker-entrypoint-initdb.d" similar to PostgreSQL's implementation #90
Conversation
for i in $(seq 30 -1 0); do | ||
[ -S "$SOCKET" ] && break | ||
mysqld --user=mysql --datadir="$DATADIR" --skip-networking --basedir=/usr/local/mysql & | ||
pid="$!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using $!
instead of parsing the mysqld
config, we can guarantee that the process is a child of our shell and thus we can wait
on it during shutdown (see below) instead of looping while we wait for it to die.
… implementation This also cleans up some minor unnecessary bits in `docker-entrypoint.sh` so that it's more consistent. Compare to https://github.com/docker-library/postgres/blob/a82c28e1c407ef5ddfc2a6014dac87bcc4955a26/docker-entrypoint.sh#L49-L97
55fa7a5
to
14f1655
Compare
LGTM |
Add support for "/docker-entrypoint-initdb.d" similar to PostgreSQL's implementation
Are there docs on this functionality? |
Looks like we forgot to do that. it should be fairly similar to the one for postgres: https://hub.docker.com/_/postgres/#how-to-extend-this-image |
Very nice! The upcoming http://dev.mysql.com/doc/refman/5.7/en/shutdown.html might help clean up the entrypoint script further. |
Thanks @ltangvald! And thanks @tianon I think this could make many people happy |
here's one: 💃 |
@ltangvald oh interesting -- I'll bet we could just use |
No, unfortunately I got a bit too excited about it :) |
This also cleans up some minor unnecessary bits in
docker-entrypoint.sh
so that it's more consistent.Compare to https://github.com/docker-library/postgres/blob/a82c28e1c407ef5ddfc2a6014dac87bcc4955a26/docker-entrypoint.sh#L49-L97
Fixes #24
Closes #87 (implements what was additionally discussed there)