docker-nginx-ssl-secure icon indicating copy to clipboard operation
docker-nginx-ssl-secure copied to clipboard

Adding a startup hook

Open databus23 opened this issue 10 years ago • 1 comments

Hi,

how do you feel about adding an optional startup hook to your ENTRYPOINT script? I want to generate some nginx config from environment variables during startup and currently would need to replace your script. Instead I think it would be useful of your script contained something like

[ -f /opt/startup_hook.sh ] && /opt/startup_hook.sh

just before starting nginx?

databus23 avatar Mar 05 '15 13:03 databus23

Thanks for the Comment, I'm also looking for something like this.

As you might have seen, in some of my own child docker containers I use sed to replace some parts of my entrypoint script and add a new line there.

So at this time the best would be to just use sed and replace something like "#!/bin/bash" with "#!/bin/bash\nyourscript.etc"

the only thing I would directly implement would be some kind of entrypoint dependency management, sort of the debian start scripts

/opt/entrypoints/00MysupercoolScript.sh /opt/entrypoints/05IGetStartedTo.sh /opt/entrypoints/99YeahStartMeAtLast.sh

And a loop over all of these files. I might check it this weekend, or you'll script it and I'll just merge it.

But try to not break anything :D my images are ment to be used in heavy production - I don't want to scare some users away by changing to much behaviour

thanks greetings

Marvin

MarvAmBass avatar Mar 05 '15 13:03 MarvAmBass