Description of configs templates? Way to substitude IP for host?

This github issue seems to be the most complete description:

This seems to be the full example that shows how all different data sources are used:

docker config create --template-driver=golang example -<<'EOF'
This template is used on service: {{.Service.Name}}
This container is running on node with ID: {{.Node.ID}}
HELLO environment variable is: {{env "HELLO"}}
Secret "secret1" contains: {{secret "secret1"}}
Some other config ("config1") contains: {{config "config1"}}
EOF

Looks like you are limited to swarm template placehoders, terminal environment variables, swarm secrets, and swarm configs.

This blog post seems to cover it in depth as well:

Though, I am not sure how template configs would help in this particular use case, where you need dynamic ip resolution for other containers.

Looks like you will have to do it the good old way: pass in an environment variable with the service name you want to resolve, then create an entrypoint script that resolves the ip of the service name, and then modifies the config file before the main process is started.