# Container name variable using UI or compose?

**URL:** <https://forums.suse.com/t/container-name-variable-using-ui-or-compose/7121>\
**Category:** Rancher 1.x\
**Created:** [August 16, 2017, 5:39pm UTC](https://forums.suse.com/t/container-name-variable-using-ui-or-compose/7121 "2017-08-16T17:39:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![D4fnk](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@D4fnk](https://forums.suse.com/u/D4fnk)\
**Post date:** [August 16, 2017, 5:39pm UTC](https://forums.suse.com/t/container-name-variable-using-ui-or-compose/7121/1 "2017-08-16T17:39:00Z")

</div>

Hey,

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](http://forums.suse.com/t/use-variable-to-create-volume-container/2202)).

Tried it like the examples from [this](https://github.com/rancher/rancher/issues/3393) and updated to the latest stable version on rancher server but i can’t make it work with container name.

Is it possible ?

Thanks !

---

<div class="post-metadata">

**Author:** ![Listener\_me](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/listener_me/32/5836_2.png) [@Listener\_me](https://forums.suse.com/u/Listener_me)\
**Post date:** [August 17, 2017, 11:18am UTC](https://forums.suse.com/t/container-name-variable-using-ui-or-compose/7121/2 "2017-08-17T11:18:46Z")

</div>

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
