I am trying to share memory between two containers by making container A’s memory shareable and allowing container B to access it.
This works outside of balena if I start the containers individually and use the following commands.
docker run --privileged --network host --ipc:shareable containerA
docker run --privileged --network host --ipc:container:<id_of_containerA> containerB
However, when I now try to start this with the following docker-compose.yml in a Balena application, container B does not start and only gives the status “downloaded”.
version: '2'
volumes:
resin-data:
services:
containerA:
restart: always
build: ./containerA_dir
network_mode: host
ipc: "shareable"
privileged: true
containerB:
restart: always
build: ./containerB_dir
network_mode: host
ipc: "service:containerA"
privileged: true
The documentation of balena directs me to the one of docker for the “ipc” flag, which says that the docker-compose should be working the same way as the regular docker commands.
The only difference between the two commands and the docker-compose would be the “service:containername” part which I think needs to be done, since I don’t know the container ID in advance.
Do you have any ideas what this could be or where I should look?