# Multiple devices, single Application

**URL:** <https://forums.balena.io/t/multiple-devices-single-application/2731>\
**Category:** Product support\
**Created:** [March 16, 2018, 5:18am UTC](https://forums.balena.io/t/multiple-devices-single-application/2731 "2018-03-16T05:18:22Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![brice](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/brice/32/484_2.png) [@brice](https://forums.balena.io/u/brice)\
**Post date:** [March 16, 2018, 5:18am UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/1 "2018-03-16T05:18:22Z")

</div>

Hi, we have an app running on different devices (ie: nuc, pi, jetson) we different Dockerfiles. Is there a way to have different types of devices on a single application or alternatively being able to use separate dockerfiles per device and pushing to different remotes.

The dockerfile.template is not appropriate as we aren’t using some of the [resin.io](http://resin.io) base images.

Thanks!

---

<div class="post-metadata">

**Author:** ![izavits](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@izavits](https://forums.balena.io/u/izavits)\
**Post date:** [March 16, 2018, 12:15pm UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/5 "2018-03-16T12:15:05Z")

</div>

Hello,  
At the moment each application is tied to a specific device type. I guess that you could add multiple remotes to your git repo, each pointing to a different resin application. Or alternatively, you could maintain multiple branches with your separate Dockerfiles. In any case, we have internally tagged your message with a feature request for applications with mixed device types.

---

<div class="post-metadata">

**Author:** ![brice](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/brice/32/484_2.png) [@brice](https://forums.balena.io/u/brice)\
**Post date:** [March 17, 2018, 9:03am UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/6 "2018-03-17T09:03:16Z")

</div>

Thanks @izavits

---

<div class="post-metadata">

**Author:** ![sqweelygig](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sqweelygig/32/150_2.png) [@sqweelygig](https://forums.balena.io/u/sqweelygig)\
**Post date:** [March 28, 2018, 9:51am UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/7 "2018-03-28T09:51:48Z")

</div>

Another quick thought on this thread is that if you use the same `%%RESIN-MACHINE-NAME%%` vocabulary in your base image catalog, then you could use `FROM brice/%%RESIN-MACHINE-NAME%%-whatever` in a dockerfile.template

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [March 28, 2018, 5:11pm UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/15 "2018-03-28T17:11:24Z")

</div>

Hi @brice, one more thing, you can create `Dockerfile` variants that can be specific to specific devices types and can exists next to each other in your code. This is using the device type 's slug, or the architecture, and priorities are observed by the builder in order of specificness.

For example, if you want one for the NUC, you could have

- `Dockerfile.intel-nuc` (most specific, extension same as `%%RESIN-MACHINE-NAME%%` would be in a template)
- `Dockerfile.amd64` (architecture level, extension same as `%%RESIN-ARCH%%` would be in your template)
- `Dockerfile.template` (least specific, captures all device types, and can use e.g. those above template variables)

So in your case you could have `Dockerfile.intel-nuc`, plus `Dockerfile.raspberry-pi` (or `.raspberry-pi2`, or `.raspberrypi3` depending on which Pi you mean), and `Dockerfile.jetson-tx2`, next to each other, and you could push the same repo to the 3 different applications (maintaining the three different git remotes).

Our documentation is a bit sparse on this, but we are trying to gather things in a non-confusing way. An example of this being used (on the architecture level) you can see in our Multicontainer Getting Started project, the haproxy service: [https://github.com/resin-io-projects/multicontainer-getting-started/tree/master/haproxy](https://github.com/resin-io-projects/multicontainer-getting-started/tree/master/haproxy)

Let us know how does it work if you try it out!

---

<div class="post-metadata">

**Author:** ![brice](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/brice/32/484_2.png) [@brice](https://forums.balena.io/u/brice)\
**Post date:** [March 30, 2018, 10:04am UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/17 "2018-03-30T10:04:44Z")

</div>

awesome thanks @imrehg didn’t know about the file naming convention for different devices 👍

---

<div class="post-metadata">

**Author:** ![jgentes](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jgentes/32/1595_2.png) [@jgentes](https://forums.balena.io/u/jgentes)\
**Post date:** [April 5, 2018, 12:43am UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/18 "2018-04-05T00:43:44Z")

</div>

Once you’ve defined different container names for different architectures, you then run into this problem - can’t use the resin variables in the docker-compose file: [Multicontainer docker-compose.yml & resin environment variables](https://forums.balena.io/t/multicontainer-docker-compose-yml-resin-environment-variables/2871)

Any thoughts on that would be appreciated.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [April 5, 2018, 12:34pm UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/19 "2018-04-05T12:34:59Z")

</div>

@jgentes replied in that thread. Please note, those are not environment variables but [Dockerfile template variables](https://docs.resin.io/learn/develop/dockerfile/#dockerfile-templates).

---

<div class="post-metadata">

**Author:** ![lekkas](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lekkas/32/78_2.png) [@lekkas](https://forums.balena.io/u/lekkas)\
**Post date:** [June 13, 2018, 9:26am UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/21 "2018-06-13T09:26:00Z")

</div>

Hi,

Just a quick update on this, while applications with mixed architectures are not yet supported, we figured you’d still be interested to know that [resin.io](http://resin.io) application now support different device types in the same application, as long as they share the same architecture. For example, you could have an application with both Raspberry Pi 3 and BeagleBone Black devices, as they both use an ARMv7 processor.

For reference, you can find the relevant documentation section [here](https://docs.resin.io/faq/troubleshooting/faq/#can-i-mix-device-types-in-an-application-).

Let us know if you have any questions or feedback!

Best,  
Kostas

---

<div class="post-metadata">

**Author:** ![wlisac](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/wlisac/32/1412_2.png) [@wlisac](https://forums.balena.io/u/wlisac)\
**Post date:** [January 11, 2019, 3:03am UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/22 "2019-01-11T03:03:46Z")

</div>

@lekkas thanks for the update – are there still plans to support mixed architectures in the future?

I’m looking to run Raspberry Pi 3 B+ and Raspberry Pi Zero W devices in the same applications.

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [January 11, 2019, 7:33pm UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/25 "2019-01-11T19:33:06Z")

</div>

Hi @wlisac, it is quite likely we will have mixed architectures in the future, but it’s not the immediate future, somewhat further down the line. It needs a few things ironed out and some decent-sized changes to our backend to work properly.

In the meantime, have to use 2 separate applications for the the Zero and the Pi3

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [January 11, 2019, 7:33pm UTC](https://forums.balena.io/t/multiple-devices-single-application/2731/28 "2019-01-11T19:33:19Z")

</div>

Hi @wlisac, it is quite likely we will have mixed architectures in the future, but it’s not the immediate future, somewhat further down the line. It needs a few things ironed out and some decent-sized changes to our backend to work properly.  
In the meantime, have to use 2 separate applications for the the Zero and the Pi3
