Files in container isnt effected by changes from host

I ask you for your help with my problem.

I use Docker desktop on macbook with M1 Pro and Monterey (12.6.1).

When I changed some php file, the file in container is effected only when I use chown or chmod commands with same or different rights.

Example how it is works:

  1. Changed php file on local/volume.
  2. Used chown or chmod commands in container terminal on the file.
  3. And now is the file effected in container by changes from local.

Used image: debian:latest (11.x)
Used packages: apache2.4, php7.4 (php7.4-fpm) and more.

Used command for create volume:
docker volume create --driver local --name debvol --opt type=nfs --opt device=${PWD} --opt o=bind

Used docker run command:
docker run -it -d -p xx:xx -p yy:yy
–name deb
–mount source=debvol,target=/var/www

Thank you for your help.

Do you have the same issue when you are not using an NFS volume but a local volume or a bind mounted local folder?

You could try to enable VitioFS which I mentioned some days ago in an other topic with a screenshot:

thank you for your answer.

I try diffirent volume settings, but same issue.

Today, I try set bind instead NFS and I have some progress.

It works until I use any command in cotainer terminal. When I use chmod/chown it works again.

I got distracted by other possible source of problem and try fix it, but it wasnt right way.

I will try next recommended volume settings, tomorrow. And I’ll let you know what happened.

I updated Docker Desktop from 4.14.x to 4.15.0 today and VirtioFS isnt beta features in the new version.

So I skip second option and try VirtiosFS.

This is it, it works.

Previous settings (General->Choose file sharing implementation for containers) is gRPC FUSE like default option.

Thank you for your help.