Get little rootfs from https://github.com/jpetazzo/docker-busybox/blob/master/tarmaker-buildroot/rootfs.tar
mkdir c1 c2
sudo tar -C c1 -xf rootfs.tar
sudo tar -C c2 -xf rootfs.tar
Now we will prepare c1 to host a shared mount with c2:
mount -o bind c1/mnt c1/mnt
mount --make-rshared c1/mnt
mount -o bind c1/mnt c2/mnt
Now let's start c1 and make our mount:
sudo unshare --mount chroot c1 sh
mount -t tmpfs none mnt
touch mnt/hello
Let's start c2 and see (in different terminal):
sudo unshare --mount chroot c2 sh
ls mnt # hello is there
In the host namespace, we can safely unmount c1/tmp and c2/tmp; however, if we do so, it becomes impossible to share them further with other containers.
Conclusion: if we make all volumes shared mounts before handing them to the container, the container can mount something on top of them, and that thing will be visible from the host, and share-able with other containers. They will have to be unmounted when the container exits, however.