# Init variable at runtime

**URL:** <https://forums.docker.com/t/init-variable-at-runtime/42738>\
**Category:** Swarm\
**Created:** [December 11, 2017, 3:28pm UTC](https://forums.docker.com/t/init-variable-at-runtime/42738 "2017-12-11T15:28:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flegaludec](https://avatars.discourse-cdn.com/v4/letter/f/f6c823/32.png) [@flegaludec](https://forums.docker.com/u/flegaludec)\
**Post date:** [December 11, 2017, 3:28pm UTC](https://forums.docker.com/t/init-variable-at-runtime/42738/1 "2017-12-11T15:28:22Z")

</div>

Hi,  
I want to dynamically fill an environment variable when I declare a service in my docker-compose file.

I think Ican do that with entrypoint :  
entrypoint: LOG\_FILE\_WS=/home/$(hostname) java -jar my.jar

where $(hostname) is an environment variable already setted on the host.  
Ideally, the variable is extracted from the node.

Is it possible?  
The idea is to fill a variable at the runtime of a container.

Thank you!
