I searched through the forum but didn’t found anything really matching.
I want to connect to a samba share to retrieve and write data not to the SD card of the raspberry pi.
I can create a container connecting to the samba share, for this a couple of entries in the forum are available. Most other entries are assuming that balena is the smb host, but in our case I’m the smb client.
The problem is that I have a multicontainer setup.
So it would mean that I have to implement the samba connection into each single container resulting in 10 smb connections from each device to the samba host.
I tried to share the connected smb share via named volumes, but the problem is that smb is mounted over the volume.
volumes:
my-data:
services:
smbclient:
volumes:
- my-data:/mnt
othercontainer:
volumes:
- my-data:/mnt
The smbclient then mounts /mnt/smbshare. Inside the smbclient container all seems good, but in all othercontainers /mnt/smbshare is empty, as the mount is not propagated.
This seems to be intended behaivor for named volumes for docker and in docker the “workaround” would be using bind-mounts which are not available.
Plugins in balenaEngine are also disabled so using netshare volume docker plugin as alternative is not an option.
As the balena host OS is read-only I’m also unaware how to install cifs-tools there, to mount it on the host side inside the volumes directory and hoping that this is maybe propagated to the containers.
So I’m currently out of ideas how I could achieve this, without having to add the samba functionallity to all needed containers, also meaning that I couldn’t use any default image from dockerhub anymore as I would need to add samba to each of them.
edit: I just found on https://www.balena.io/docs/learn/develop/runtime/
Note that currently it’s not possible to share a mounted device across multiple containers. This is a feature that we are currently working on. This documentation will be updated once we add support for this feature.
Do I assume correctly, what I try to achieve its not possible?