Skip to content

How to debug templates? #618

Answered by mmerickel
budarin asked this question in Q&A
May 9, 2022 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

This doesn't help debug a specific template, but it has helped me a lot in sorting through the available data. It'd be nice if this were a little more prominent imo.

docker-gen.cfg:

[[config]]
template = "/etc/docker-gen/templates/debug.tmpl"
dest = "/tmp/docker-gen.json"
notifycmd = "/bin/true"
watch = true

debug.tmpl:

{{ json (dict "Docker" .Docker "Env" .Env "RuntimeContainers" $) }}

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@buchdag
Comment options

Answer selected by buchdag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #433 on May 16, 2024 12:19.