How to access dbus consistently in multicontainer apps?

I’m writing a multicontainer app that needs dbus access.

The resin label io.resin.features.dbus: '1' that auto-mounts the host /var/run/dbus into /host/run/dbus doesn’t appear to work in local mode, when using the docker remote API to bring the compose environment up. Nothing shows up at /host in the container, so I assume this label feature must be implemented in a magical way that requires something more than docker/balena on the host.

So I resorted to bind-mounting '/var/run/dbus:/var/run/dbus' in the compose file so that I have dbus when in local mode.

However, this bind mount is not allowed in the Resin build server: [Error] Bind mounts are not allowed, and so I cannot build the application or push it to the fleet via Resin.

So, what’s the correct way to access the system dbus socket in a multicontainer app?

hey @mgreensmith, yeah unfortunately the local development experience doesn’t currently support multicontainer and in we don’t use docker-compose, but rather the resin-supervisor brings up the composition with the correct bind-mounts, etc based on the compose.yml. We are currently working on bringing multicontainer to the local dev Experience and you can track the feature here:

I think the current best approach would be to have a docker-compose-local.yml that you use for local dev, with your bind-mount in the compose. Obviously this isn’t super great because you have to maintain two compose files :confused: