Skip to content

Commit

Permalink
v1.0.4 Mention Toml support
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesParrott committed Oct 28, 2023
1 parent 7bd3d66 commit 1e0155f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ Dockerfiles for some official images are already generated using an [alternative


## Config files

Toml is supported where tomllib is available (>= Python 3.11)

### 'JSON' Example.
```
{"config" : # Required boilerplate. Makes the code tidier.
Expand Down Expand Up @@ -85,11 +88,10 @@ Dockerfiles for some official images are already generated using an [alternative
}
```
## Development
Following a couple of months break from it, and after having worked on Dockerfile_generator again, I now fully appreciate the wisdom of not implementing business logic in a templating language. However this does bring some advantages.

Other than a small CLI wrapper and the tests, the working code in this branch is pure Jinja2 Templates plus Json config files. It works by and large - it generates Dockerfiles that Hadolint only has minor differences of opinion with me about. However it does contain the hardest to maintain, and outright ugliest code I've ever written!
Other than a small CLI wrapper and the tests, the code is pure Jinja2 Templates plus JSON config files. It works well - it generates Dockerfiles that Hadolint only has minor differences of opinion with me about. Following a couple of months break from it, and after having worked on Dockerfile_generator again, I now fully appreciate the wisdom of not implementing business logic in a templating language. The templates contain the hardest to maintain, and outright ugliest code I've ever written!

By keeping this project pure Jinja 2, advanced users and devs alike (that are willing to learn the basics of Jinja 2), are able to access vastly more flexibility in how they use it, or part of it, by the native mechanisms of Jinja 2 alone. Namely: imports, template inheritance, overrides, and includes, of any of the sub templates (.jinja files).
However, the self-contained templates have one major advantage. Advanced users and devs alike (that are willing to learn the basics of Jinja 2), are able to access vastly more flexibility in how they use any part of it, by the native mechanisms of Jinja 2 alone. Namely: imports, template inheritance, overrides, and includes.

In future the CLI wrapper could be developed to include more of the logic, for example to send requests to a package manager API to check the packages to be installed are correct.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "dockerfile_generator"
version = "1.0.3"
version = "1.0.4"
license = {file = "LICENSE"}
authors = [
{ name="James Parrott", email="james.parrott@proton.me" },
Expand Down

0 comments on commit 1e0155f

Please sign in to comment.