Skip to content

Conversation

develop7
Copy link
Collaborator

@develop7 develop7 commented Sep 24, 2025

Introduces a Dockerfile generator in an attempt to finally eliminate the copy&paste.

The generator is essentially a program that feeds template/Dockerfile.jinja template (in the (in)famous Jinja syntax; powered by our own Ginger) with the data from YAML files scattered across the repository and prints a Dockerfile. The choice of Jinja for templates and YAML for data is a middle ground between correctness and accessibility. Generated Dockerfiles are supposed to be checked in to version control regardless, so it doesn't change much the workflow as a whole — it just makes updating images along almost trivial, eliminating the most tedious part of the maintainer's job.

I also took the liberty to enhance the Dockerfile template slightly, in particular:

  • converted RUN stanzas to heredoc syntax dropping these nasty \; trails on every line
  • upgraded ENV stanzas so the build won't fail
  • wrapped raw strings with quotes where applicable, just in case

Things to fix:

  • make generator easier to run by wrapping it to generate.sh or something. @jhrcek @chreekat I'm open for suggestions.

@develop7 develop7 requested a review from chreekat September 24, 2025 14:02
@develop7 develop7 force-pushed the feat-dockerfiles_generator branch 13 times, most recently from 0e20b3f to 773ed0b Compare September 30, 2025 10:34
@develop7 develop7 force-pushed the feat-dockerfiles_generator branch from 773ed0b to 9ddb36e Compare October 2, 2025 11:29
@develop7 develop7 marked this pull request as ready for review October 2, 2025 12:38
@develop7 develop7 requested a review from jhrcek October 2, 2025 12:39
@develop7 develop7 force-pushed the feat-dockerfiles_generator branch from 9ddb36e to 724f566 Compare October 2, 2025 14:26
Copy link
Collaborator

@jhrcek jhrcek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having some automation around this makes sense to me as long as we're keeping the generated dockerfiles in git. I don't see any immediate issues with this, so 👍 from me

@develop7
Copy link
Collaborator Author

develop7 commented Oct 2, 2025

Having some automation around this makes sense to me as long as we're keeping the generated dockerfiles in git. I don't see any immediate issues with this, so 👍 from me

Yes, I could not agree more and that was the intent from the day 0. Let's merge and see how it works.

@develop7 develop7 merged commit 64d7e9b into haskell:master Oct 2, 2025
15 checks passed
@develop7 develop7 mentioned this pull request Oct 2, 2025
@chreekat
Copy link

chreekat commented Oct 7, 2025

Nice work! As a followup, maybe we could have a GitHub workflow that confirms that the generated Dockerfiles are in sync with the generator script. :)

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

Successfully merging this pull request may close these issues.

3 participants