Container name variable using UI or compose?


Is it possible to get the container name in a variable using UI ?

For example i know i can use a compose file with {{ .Stack.Name }} and i will get the stackname but i would like to be able to do the same with container name (for dynamic volumes naming while scaling services, kinda similar to this post).

Tried it like the examples from this and updated to the latest stable version on rancher server but i can’t make it work with container name.

Is it possible ?

Thanks !

Guess dns names would help?

You can use . to access a container eg: mystack.myservice
If u want to access the first container of particular service, use --1
eg: mystack-myservice-1