Open titilambert opened 9 years ago
Hmm, you shouldn't need to manually add /dev/shm, it should be provided by default (per the appc spec - https://github.com/appc/spec/blob/master/spec/OS-SPEC.md) - are you definitely not seeing it without that volume?
On Thu, Aug 27, 2015 at 10:09 AM, Thibault Cohen notifications@github.com wrote:
Hello,
I need to share /dev/shm to my containers and it's doesn't work. I found a workaround using volumes
... "mountPoints": [ { "name": "dev-shm", "path": "/dev/shm", "readOnly": false }, ...
When I start the pod (with --volume dev-shm,kind=host,source=/dev/shm), the first thing I do is to umount /dev/shm from the container ...
— Reply to this email directly or view it on GitHub https://github.com/coreos/rkt/issues/1334.
We talked about this yesterday on IRC.
The default /dev/shm
works but what the op wants is to share the host's /dev/shm
between several containers using a volume.
The volume is mounted correctly by systemd-nspawn but then systemd in stage1 mounts a fresh /dev/shm
on top, masking it. Hence, to see the host's dir (volume) it needs to be unmounted.
This looks like a very hacky way to share memory between containers (and the host). The allocated memory will not be accounted for the container(s) either. Personally, I'm undecided if this is a good idea to say the least.
@titilambert: have you solved the use-case differently by now or are you still planning on sharing /dev/shm
between multiple containers? Have you considered using an in-memory database and/or sharing a UNIX domain socket between your containers?
Hello,
I need to share /dev/shm to my containers and it's doesn't work. I found a workaround using volumes
When I start the pod (with
--volume dev-shm,kind=host,source=/dev/shm
), the first thing I do is to umount /dev/shm from the container ...