Docker and shared memory optimization?
This question is discussed in some detail in issue 7950  The conclusion seems to be that:


Depending on your storage configuration, the kernel page cache may be used if multiple containers are accessing the same file (e.g., see OverlayFS and Docker Performance).
You may be able to enable Kernel same-page merging through use of of the ksm_preload tool.