docker-gen icon indicating copy to clipboard operation
docker-gen copied to clipboard

How to debug templates?

Open budarin opened this issue 3 years ago • 3 comments
trafficstars

How to debug templates? Are there any good practices? Or only by trial and error and endless restarts?

budarin avatar May 09 '22 15:05 budarin

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?

budarin avatar May 09 '22 16:05 budarin

I agree. We need a way to be able to debug a template.

daiyam avatar Jun 11 '22 19:06 daiyam

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" $) }}

mmerickel avatar Nov 06 '23 01:11 mmerickel