-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Feature: adding hook to execute additional scripts on startup #31
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
Conversation
This will close both docker-library#18 and docker-library#24. The scripts are located in the /docker-entrypoint-initdb.d directory. Paired on this with @benkiefer
We will just need to document the limitations of |
LGTM |
We added the docs in this PR. |
One more thing, we also added the directory creation to the docker file. |
Doesn't this break if there are no files in |
@md5 is correct, we could just add a |
@md5 @yosifkit @benkiefer Fixed. Thanks for the catch! |
Just checking to see if this was ready to merge. If there is anything else you need let us know. |
The indentation here seems off. Is it using space instead of tabs? Also, I'm not 100% comfortable with this unless we have some solid documentation for what the exact limitations are. People are inevitably going to run into issues with it, and then come asking why their huge mysqldump file doesn't work properly as-is, since there won't be much in the way of helpful output when it doesn't work. I think a better stepping stone would be to emulate exactly what Postgres is doing for now, and improve there first. Here's something I've been playing with to implement over there: for f in /docker-entrypoint-initdb.d/*; do
case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;;
*.sql) echo "$0: running $f"; gosu postgres postgres --single -E < "$f" ;;
esac
done |
@tianon I just run into one of such limitations (line length limit) with a dump and the effect is that the the DB was initialized and the container was runnging but some tables were missing so it took a while to figure out what was the problem. |
Can you post your setup so that we can see what you are doing? It sounds like you are doing a dump on container startup? |
@benkiefer sorry, I wasn't clear. I just want to confirm the @tianon statement that people will run into issue with this implementation as I did. My problem was that I was trying to import during the container startup a previously generated dump. Unfortunately the dump contained a pretty long statement (90,000 characters) and the mysql init file is limited to 20,000 characters (http://bugs.mysql.com/bug.php?id=67345 and they won't fix it). |
is there any movement on this? i could really use the functionality this will provide. |
I think @tianon was working on a set closer to what we have in the postgres image (to include bash scripts as well as sql), but this will still be very limited and needs documentation to cover the caveats. |
is there another issue tracking this since you closed this one? as a work around for anyone else, you could copy the entrypoint script that the container uses and append your init script contents to the end. if you're using |
There is not another issue. I was working through the comments but no On Saturday, January 24, 2015, Jae Gangemi notifications@github.com wrote:
Sent from Gmail Mobile |
then shouldn't it be enough to provide a link to the mysql docs for the if that's what it takes to get this into the official build, i'd be happy to create a pull request. if there's something else, please let me know and i can look to address it. having this as part of the official image would be extremely helpful to me (and i'm sure others). |
Go ahead and try that. LGTM. I gave up as I felt they wanted me to research On Saturday, January 24, 2015, Jae Gangemi notifications@github.com wrote:
Sent from Gmail Mobile |
- remove the hirak/prestissimo plugin because its not required for composer v2 - add 'platform: linux/amd64' to the mysql container in the docker-compose file to fix issues with M1 Mac users - see docker-library/mysql#31
This will close both #18 and #24.
The scripts are located in the /docker-entrypoint-initdb.d directory.
Paired on this with @benkiefer