How to have the same functionality as lsyncd sharing a folder from host in linux container

I want to share my python projects folder with the container but I don’t want the container to be able to write to the host but I need it to be able to edit files in the projects folder on certain files only in the container.

The way I lsyncd works is when running it will always be updating the files from host to guest unless I have told it to exclude a file. So I can edit files on the guest and the changes in that folder will change locally and will not get updated from host if I have set the exclude. They never get changed on the host that way either.

So how could I have the same in lxc share. Where it only reads the host’s share but can read/write locally. Mostly read-only is fine but on certain scripts they need to write as well as they update files as they go deleting items etc, but I need that only locally on the container.

You could manually do this with a ton of bind-mounts into your container, some read/write, some read-only but that may get pretty annoying pretty quickly. Or you could bind-mount the whole thing read-only and then mount an overlay filesystem on top to make things writable inside the container (but those changes wouldn't show up back at the source).

Or possibly even easier, why not just use lsyncd between your host and container?

Yup I will stick with lsyncd then :slight_smile: if that is the easiest solution. Just wanted to check it was going to be the best way. Thanks for clarification.