# Environment Variables or volumes\_from?

**URL:** <https://forums.suse.com/t/environment-variables-or-volumes-from/863>\
**Category:** Rancher 1.x\
**Created:** [November 4, 2015, 8:13am UTC](https://forums.suse.com/t/environment-variables-or-volumes-from/863 "2015-11-04T08:13:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rucknar](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rucknar/32/107_2.png) [@Rucknar](https://forums.suse.com/u/Rucknar)\
**Post date:** [November 4, 2015, 8:13am UTC](https://forums.suse.com/t/environment-variables-or-volumes-from/863/1 "2015-11-04T08:13:46Z")

</div>

I’m migrating an application into rancher/docker that has a requirement for a large shared config file that all 20 services require access to. Now, originally we mapped this through from the host so we could vary it per environment. I’ve just finished migrating it to confd and i have a question about variables.

I effectively want to set environment variables at the stack level and have them accessible to all hosts, is this achievable? Might i be able to use the metadata service for this? I can always set them per service but it’s around 10 variables i’m setting here and would make my compose files quite messy.

My other option is to use volumes\_from and have a ‘data container’ per functional environment. My issue with this though is the sidekick relationship would mean i have a ton of data containers when i only really need one.

Open to suggestions!! 😄

---

<div class="post-metadata">

**Author:** ![mishak](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/mishak/32/412_2.png) [@mishak](https://forums.suse.com/u/mishak)\
**Post date:** [November 5, 2015, 7:03pm UTC](https://forums.suse.com/t/environment-variables-or-volumes-from/863/2 "2015-11-05T19:03:24Z")

</div>

Sounds like your config file should be a service 🙂

1. Prepare configuration for services.  
config\_parser\_service ▶ (write settings) ▶ redis\_instance
2. Use configuration across services  
redis\_instance ◀ (use backend) ◀ confd (sidekick)

---

<div class="post-metadata">

**Author:** ![Rucknar](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rucknar/32/107_2.png) [@Rucknar](https://forums.suse.com/u/Rucknar)\
**Post date:** [November 5, 2015, 7:21pm UTC](https://forums.suse.com/t/environment-variables-or-volumes-from/863/3 "2015-11-05T19:21:13Z")

</div>

Interesting Idea! It would allow me to manage that information and version it inline with our apps.  
Thanks Mishak!
