docker-gen
docker-gen copied to clipboard
How to debug templates?
trafficstars
How to debug templates? Are there any good practices? Or only by trial and error and endless restarts?
Is there a way to get all the information from docker and upload it as json so that you can debug with some third-party go utilities?
I agree. We need a way to be able to debug a template.
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" $) }}