Suppose I have NodeJS application inside of Docker container. NodeJS can interact with host's filesystem using fs
module. What I want is to give it access only to one folder (for example, /home/user1/thisfolder), and deny reading/writing any other folder or file on my host. Is there a way to restrict such kind of access in Docker?
UPD GOT ANSWER:
Using AppArmor I could give node
process only access to given directories, and when it tries to acces any other - it gets permission denied
.