grammarly/rocker

Allow templates in external files?

kinghajj opened this issue · 3 comments

I'm working on defining all of our images off of debian:jessie, eschewing all other Docker Hub images. As part of this, I'm defining copious templates for repeated sequences of steps (e.g. installing Java, Python, etc.), as those will be reused by both the build images (which have a lot of extra tools, like compilers) and the runtime images (which only have the absolute minimum number of packages needed to run the build artifacts). However, my Rockerfile is already serveral hundred lines of fairly-dense shell code, so I'd like to split these into separate files to make the main Rockerfile more declarative. I tried moving one template definition into a file and including it via {{ template "devops/build/templates/java" }}, but that failed:

FATA[0000] Error executing template /home/samf/armada/Rockerfile, error: template: /home/samf/armada/Rockerfile:254:12: executing "/home/samf/armada/Rockerfile" at <{{template "devops/b...>: template "devops/build/templates/java" not defined

Looking at the Golang html/template documentation, it appears that these external files have to be specified manually. I'm not terribly familiar with Golang templates, so would it be possible for Rocker to detect this and include these external files so that the engine correctly instantiates them?

Hi.
I made simple PoC. Let's wait for Grammarly reviewers to prove it.

Another approach for a subset of problems is to have an "ADD+RUN" command that has the following equivalent in docker land (only without the extra layer):

ADD foo.sh
RUN foo.sh a b c && rm foo.sh

Thanks for requesting. Unfortunately, we are discontinuing this project. See the notice here: https://github.com/grammarly/rocker/blob/master/README.md

Closing this issue as we are not able to implement it. Sorry.