Container access to /var/lib/NetworkManager on host

We have a multi container balena app, where one container is responsible for managing network access of the device. The container communicates with the host networkmanager instance via DBUS, connecting and disconnecting from networks as needed, managing connection settings, configurations, etc. One of the functions of the container is to enable connection sharing across two interfaces, and this involves using networkmanager’s embedded dnsmasq service. We are able to enable this without an issue, but there is no DBUS function to get the DHCP leases that have been allocated. The leases are stored in a file on the host OS in the directory /var/lib/NetworkManager. I understand that bind mounts are not allowed in balena apps, and it looks like there is no “io.balena.features” label to bind mount this directory for me, so I’m wondering how I can access the data?

Hi there, one hack-tastic way would be to configure SSH key in config.json and have the container shell into the host to get the file contents. Alternatively, you could map docker/balena socket into you container, and use docker-cli to run a temporary container with a custom bind mount (bind mounts are only enforced by the supervisor).