# Ignore unavailable devices in docker-compose

**URL:** <https://forums.balena.io/t/ignore-unavailable-devices-in-docker-compose/350234>\
**Category:** General\
**Tags:** docker, docker-compose\
**Created:** [November 22, 2021, 4:31pm UTC](https://forums.balena.io/t/ignore-unavailable-devices-in-docker-compose/350234 "2021-11-22T16:31:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shawaj](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shawaj/32/8203_2.png) [@shawaj](https://forums.balena.io/u/shawaj)\
**Post date:** [November 22, 2021, 4:31pm UTC](https://forums.balena.io/t/ignore-unavailable-devices-in-docker-compose/350234/1 "2021-11-22T16:31:47Z")

</div>

If I put the following on a device that has i2c bus 1 and 7 on the host (RockPi) it builds and runs successfully:

```auto
devices:
      - /dev/i2c-7:/dev/i2c-7
      - /dev/i2c-1:/dev/i2c-1

```

However if I deploy this to a raspberry pi which doesn’t have i2c-7 then it fails to start the containers.

Is there a way to solve this without multiple docker-compose files / multiple repos?

Thanks

(P.S. I know I can use `privileged: true` but want to avoid that)

---

<div class="post-metadata">

**Author:** ![rahul-thakoor](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rahul-thakoor](https://forums.balena.io/u/rahul-thakoor)\
**Post date:** [March 23, 2022, 12:19pm UTC](https://forums.balena.io/t/ignore-unavailable-devices-in-docker-compose/350234/8 "2022-03-23T12:19:23Z")

</div>

Hey Aaron!

As of today, unfortunately there is no way to do this . This would ideally be achieved via [docker compose overrides](https://docs.docker.com/compose/extends/) but balena does not support it. We have an internal ticket tracking this and will inform you of the outcome.

Thanks

---

<div class="post-metadata">

**Author:** ![maggie0002](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@maggie0002](https://forums.balena.io/u/maggie0002)\
**Post date:** [March 23, 2022, 3:01pm UTC](https://forums.balena.io/t/ignore-unavailable-devices-in-docker-compose/350234/10 "2022-03-23T15:01:51Z")

</div>

Does Balena CLI support environment variables ([Environment variables in Compose | Docker Documentation](https://docs.docker.com/compose/environment-variables/))?

Could replace some of those volume paths with an environment variable, then try launching by passing a different variable each time. Not ideal, but if it supports env vars could be a way to go.

---

<div class="post-metadata">

**Author:** ![builder555](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@builder555](https://forums.balena.io/u/builder555)\
**Post date:** [June 29, 2022, 7:03pm UTC](https://forums.balena.io/t/ignore-unavailable-devices-in-docker-compose/350234/11 "2022-06-29T19:03:54Z")

</div>

Hello,

Unfortunately, at this time it does not: [docker-compose.yml fields - Balena Documentation](https://www.balena.io/docs/reference/supervisor/docker-compose/#known-unsupported-features)
