-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/docker-entrypoint-initdb.d/ equivalent for scripts at every start? #642
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
Comments
Something like this MariaDB/mariadb-docker#284 (comment)?
|
Do you mean this: MariaDB/mariadb-docker#284 (comment)? It's a possible solution but writing your own Moreover is the API compatibility of bash functions in |
The functions not beginning with an underscore are considered the "public" interface of the script when sourcing it and so will be kept as a stable as possible (functionality, names, and arguments will be very unlikely to change). On the flip side, functions beginning with an underscore are "private" and can change at any time. I am trying to work on documenting their intended functionality and any arguments, but haven't been able to get to it yet. The spreadsheet linked from #471 contains their current description and any discussion of their creation (and any that accept arguments should be commented in the function itself). |
Going to close as this seems sufficiently answered |
Yeah I managed it, thanks. |
Feature
Would it be possible to have a
/docker-entrypoint-initdb.d/
equivalent for scripts that should be run before the database is externally accessible at every container startup?Use case
My specific use case is to run migration scripts at container startup.
Implementation idea
The way I'm imagining it is extending
docker-entrypoint.sh
so that:/docker-entrypoint-startdb.d/
(noticestartdb
instead ofinitdb
) exists/docker-entrypoint-startdb.d/
exists/docker-entrypoint-startdb.d/
directory after the/docker-entrypoint-initdb.d/
scriptsRationale
It's very difficult to extend this image with this functionality without writing a custom
docker-entrypoint.sh
file (which would then not be updated when this image gets updated).The text was updated successfully, but these errors were encountered: