5 ms·
2 does not work for many scenarios. You end up having to build all the FROM combinations which quickly grows out of practicality. 3. use any templating system
by FatalBaboon 10y ago
2 does not work for many scenarios. You end up having to build all the FROM combinations which quickly grows out of practicality.
3. use any templating system you like
For example, I make mixins out of little bash scripts (mostly heredocs) that outputs Dockerfile lines. Mixins are shared between projects via git submodules. Voilà.
I don't like configuration management mainly because the syntax is plain stupid, making it difficult to read. Check out Ansible and you'll know what I mean... although I do I have some hope in Terraform once they roll out their feature of "write out the config files out of whatever I already have in that AWS account" (not having to write the config scripts from scratch gives me a tailored example to learn from).
Whenever some bash script gets big (say, 100LOC), it gets rewritten in ruby.
- jacques_chester 10y agoI feel that writing a code-generator for Dockerfiles is a strong smell that they are insufficiently expressive for their task. And nor should they be, given the unavoidable constraints of the design. > Whenever some bash script gets big (say, 100LOC), it gets rewritten in ruby. 100? You have patience I lack.
- FatalBaboon 10y agoI think of Dockerfiles as a very static piece of code, it urges you to use templates on it. Just like for a nginx.conf And 100LOC, well, I've gotten very much used to bash. It is so comfortable when the terminal is your REPL. To tell you the truth my main deploy script is actually 500LOC of bash. It reads top to bottom with a lot of conventions (I was suprised to follow google's bash conventions), and short circuiting abuse.
- majewsky 10y ago> their feature of "write out the config files out of whatever I already have in that AWS account" Whenever I tell people about my own config mgmt solution (http://holocm.org http://holocm.org), this is the immediately most-requested feature. They say "I would like to start using configuration management for my system, but I don't want to reinstall my system." So there needs to be some way to serialize all the changes one has made to the system since its installation.
- okso 10y agoI understand the point about Ansible being hard to read, I find SaltStack much more decent regarding syntax, or PyInfra regarding new kids in the game. Regarding building Dockerfiles using bash scripts or Ruby, I find the concept interesting but using 'scripts' feels wrong. Building a 'standard' library to generate Dockerfiles on the other hand might be an interesting project that would allow collaboration.