# Parametrized application launch

**URL:** <https://forums.balena.io/t/parametrized-application-launch/47060>\
**Category:** Product support\
**Created:** [November 27, 2019, 9:53am UTC](https://forums.balena.io/t/parametrized-application-launch/47060 "2019-11-27T09:53:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![khancyr](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/khancyr/32/2809_2.png) [@khancyr](https://forums.balena.io/u/khancyr)\
**Post date:** [November 27, 2019, 9:53am UTC](https://forums.balena.io/t/parametrized-application-launch/47060/1 "2019-11-27T09:53:45Z")

</div>

Hello,

I am new to BalenaOS and Cloud and I have an issue. Here is what I would like to do.  
I got two devices. Both get the same application.  
What I want to do it to be able to launch as much instance of the application (in docker) with different parameters.  
Example :

- Case 1 :
  - Device 1:
    - app with ID=1
    - app with ID=2

  - Device 2:
    - app with ID=3
    - app with ID=4

- Case 2 :
  - Device 1:
    - app with ID=5
    - app with ID=2

  - Device 2:

What would be the simpler way to do that ?  
I think at some solution :

- pushing a new docker\_compose file each time I want a modification
- add a web app to launch the new docker instance on fly
- something with service or environment variable ? But I didn’t find how to …  
But can’t we do that from the could management interface ?

I hope I was clear enough on what I want to do. Does somebody got an idea on how to do that ?

---

<div class="post-metadata">

**Author:** ![karaxuna](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@karaxuna](https://forums.balena.io/u/karaxuna)\
**Post date:** [November 27, 2019, 10:47am UTC](https://forums.balena.io/t/parametrized-application-launch/47060/6 "2019-11-27T10:47:35Z")

</div>

Hi, you can do this via balena dashboard through device summary -\> Device Service Variables -\> add variables for specific services. Is this what you are looking for?

---

<div class="post-metadata">

**Author:** ![karaxuna](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@karaxuna](https://forums.balena.io/u/karaxuna)\
**Post date:** [November 27, 2019, 10:55am UTC](https://forums.balena.io/t/parametrized-application-launch/47060/7 "2019-11-27T10:55:07Z")

</div>

If you’re trying to run different services based on environment variable, you can take a look at similar forum thread: [Selectively running containers on a device](https://forums.balena.io/t/selectively-running-containers-on-a-device/16086/19)

---

<div class="post-metadata">

**Author:** ![khancyr](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/khancyr/32/2809_2.png) [@khancyr](https://forums.balena.io/u/khancyr)\
**Post date:** [November 27, 2019, 11:14am UTC](https://forums.balena.io/t/parametrized-application-launch/47060/9 "2019-11-27T11:14:54Z")

</div>

Hello,

thanks you for the fast response ! I seems to match my use case, I will try this solution !

---

<div class="post-metadata">

**Author:** ![khancyr](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/khancyr/32/2809_2.png) [@khancyr](https://forums.balena.io/u/khancyr)\
**Post date:** [November 27, 2019, 1:19pm UTC](https://forums.balena.io/t/parametrized-application-launch/47060/11 "2019-11-27T13:19:18Z")

</div>

It looks like docker compose scale feature would be a good candidate but this isn’t supported yet

---

<div class="post-metadata">

**Author:** ![richbayliss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/richbayliss/32/1054_2.png) [@richbayliss](https://forums.balena.io/u/richbayliss)\
**Post date:** [November 27, 2019, 2:38pm UTC](https://forums.balena.io/t/parametrized-application-launch/47060/12 "2019-11-27T14:38:13Z")

</div>

Hey,

So I think the solution we have with balenaCloud isn’t suited to do what you want directly; but it would be possible for you to create a container and run balenaEngine within that container and drive it via a second service or environment variables. It would be a very technically challenging project though, so I don’t know if that’s something you want to undertake.

I am not aware of any sample projects we have which do this, so I cannot point you to anything unfortunately, but we would be interested to see how it worked out or if you found a different approach 👍

---

<div class="post-metadata">

**Author:** ![khancyr](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/khancyr/32/2809_2.png) [@khancyr](https://forums.balena.io/u/khancyr)\
**Post date:** [November 27, 2019, 2:49pm UTC](https://forums.balena.io/t/parametrized-application-launch/47060/14 "2019-11-27T14:49:13Z")

</div>

the scale feature from docker compose would be the better approach I think.  
For now my use case is quite simple so I got on the manually added variable road. I won’t be as simple as just have one service defined in the .yml but at least I will be able to launch/stop and modify each application from balenacloud, so that is cool !  
I will share later my demo and the code !
