Skip to content
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

Template pre-processing of the makefile #44

Open
epcim opened this issue Feb 8, 2018 · 2 comments
Open

Template pre-processing of the makefile #44

epcim opened this issue Feb 8, 2018 · 2 comments

Comments

@epcim
Copy link

epcim commented Feb 8, 2018

If I am aware there is not better Makefile/build a framework to compose images as in this tool. I have some suggestions/enhancements:

Add "Jinja2" processing of the makefile before yaml is parsed, to allow things like:
% for os_codename in [xenial, bionic]
debian-{{os_codename}:
FROM: debian:{{os_codename}}
% endfor

@avirshup
Copy link
Owner

avirshup commented Feb 22, 2018

Thanks for your comments and issues, @epcim! I agree that would definitely be great to have methods for additional parameterization within the docker-makefile.

For my personal use cases, docker build-args have gone a long way towards addressing this need. Jinja is a little out of scope for my conception of this tool - if I personally needed this functionality, I'd likely just use a separate Jinja CLI tool to generate DockerMake.yml, rather than building templating into docker-make.

@epcim
Copy link
Author

epcim commented Feb 22, 2018

I think so finally, jinja2 is out of scope. For anything other, I found pyInvoke (python kind of Makefile) can do the remaining magic quite well. https://github.com/epcim/docker-salt-formulas/blob/master/tasks.py

What I would like to see anyway is "args" to tasks names and have them available in FROM. Simply as python Template formatting stuff, not the jinja. I know it may pain for "keys" but it's doable.

# --build-arg os_codename=stretch

debian-${os_codename}:
  FROM: debian:${os_codename}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants