Closed scop closed 8 months ago
:eyes:
(If you remove the excitability bit on your initdb scripts, they'll be sourced instead and have direct access.)
(If you remove the excitability bit on your initdb scripts, they'll be sourced instead and have direct access.)
I know, but the executability check is unreliable, and doing that causes other problems: https://github.com/docker-library/postgres/issues/1108
A reliable workaround against that is to make all .sh scripts executable, which then leads to this issue. Could you reconsider reopening/applying this?
If you need to work around #1108 too, I'd suggest something like this:
if ! command -v docker_process_sql > /dev/null; then
source /usr/local/bin/docker-entrypoint.sh
fi
...
(the script is officially intended to be sourced in this way, and that is the canonical supported path for doing so)
This way, executed bash initdb scripts do not need to source the entrypoint script (nor hardcode its path) to be able to use the function.
Note that the export only works for executed bash scripts.
Not crucial by any means, but I think it'd be nice to have.
Could apply to < 16 entrypoints too, if this is seen desirable.