-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Environment variable substitution and other entrypoint scripts #431
Comments
Why not just #!/bin/sh
export FOO_BAR='baz buzz'
exec /docker-entrypoint.sh "$@" |
Yes I could do this. Thanks for the suggestion. It does push my script outside of the |
I would like to suggest a different alternative where https://github.com/nginxinc/docker-nginx/blob/master/entrypoint/docker-entrypoint.sh#L22 |
See #687 for another PR willing to do similar things. I'm reluctant to changing the docker-entrypoint.sh script to source the scripts since it might break someone's workflow. Adding an option to source a What do you think? |
My proposal is adding additional case for eg. docker-nginx/entrypoint/docker-entrypoint.sh Lines 18 to 29 in f3d86e9
Those files would be sourced instead of being called directly. This would preserve backwards compatibility and add this feature we want and make some things possible without override of docker container entrypoint. What do you think guys? This will solve my problem and it looks like it will solve @rgov's problems too. |
FWIW, my variant of patch is something like:
|
This one is IMO worse as it doesn't allow defining more than one hook script, naming it in user-readable form and doesn't allow changing order of executing. Allowing more than one script is crucial in situations like when one script is provided by image |
I updated #687 to show my solution ;D |
Fixed in 6675128 |
I have an entry point script that derives a path and then uses
sed
to write it into my nginx config.I recently moved this over to a script in
/docker-entrypoint.d
. Then I noticed that there is theenvsubst
script, which maybe I could re-use instead ofsed
.However, there is no way for my earlier entry point script to set an environment variable that gets picked up by the
envsubst
script.Any thoughts on how this could be accomplished? For instance, I could append to a .env file that gets
source
'd. I'm also willing to concede it might be overly complicated to try to make such a thing work.The text was updated successfully, but these errors were encountered: