Add option for root overlay mount in runsc.
Add option for root overlay mount in runsc.
This patch adds a flag to runsc to set up the root filesystem with overlayfs which has an upper layer of tmpfs and lower layer of gofer. The tmpfs is backed by a regular file on the host.
So all file data in tmpfs will be stored on the host, not in sentry memory. But the tmpfs filesystem tree will still be stored in sentry memory.
This helps avoid expensive communication with the gofer process. More importantly, the root filesystem of the container is not preserved across container lifecycle. So we don't need to keep updating the host filesystem, which will anyways be destroyed once the container is destroyed. It is wasted effort. Instead we keep all the changes to the root filesystem in tmpfs which is directly accessible by the sentry.
Co-authored-by: Andrei Vagin [email protected]