martialblog/docker-limesurvey

Tweak entrypoints.sh

JensHeinrich opened this issue · 3 comments

Reuse entrypoint.sh to have coderepetition

I gotta do more research on that, but maybe we can get some inspiration from the docker.io offical Images.

They use templates for the Dockerfiles and entrypoints that are used to generate the respective files. For example: https://github.com/docker-library/wordpress/blob/master/apply-templates.sh

While this would reduce the duplicated code, it would introduce some overhead.

Would it be a dumb idea to share the context (folder with script) and declare the dockerfile explicitly?

And split of the repeating code into a lib file declaring the common operations as a function to be called from the entrypoint.sh ?

So basically use ONE Dockerfile and name the different stages with FROM .. AS limesurvey:5.0 like described here and build them from there?