Linux – Read only bind-mount

bindlinuxmountnfsread-only

I use mount -o bind to mount directories inside chroots, which works really well. The problem is that I'd like some of these bind-mounted directories to be read only in chroot.

Is it possible? If not – any other way to achieve it?

I was thinking about using NFS for localhost mounts, but it looks like overkill.

Best Answer

According to this article is it is possible. You do need a recent kernel.

mount --bind -o ro /vital_data /untrusted_container/vital_data