I am trying to get specific information from 'docker service inspect' command and I like json format but I am noob in go templates and I do not know how to iterate across an array and get the object properties, I would appreciate any help on this. ah! I cannot install anything, IT policies :( so need to work with what I have.
I have this so far, as you can see I am able to access the n element in the array (Secrets) but I don't know how to fully iterate Secrets
docker service inspect --format='{{(index .Spec.TaskTemplate.ContainerSpec.Secrets 0).SecretName}}' <paste_your_service_id>
The final goal is knowing what service uses what secret (the first service matching would work) then finding a way to connect to the first worker node running the container and run "docker exec -t <container_id> cat <secret_path>" for the secretName I am looking for.
Thanks in advance!