Docker VOLUME created a directory. I added files to the container. Why didn’t the host directory appear?

  docker, question

I am using a mirror image of dockerfile build:
VOLUME /home/user/web
I open the container, go to bash, go to this directory, and create a new file.
Then I went back to the host directory to check, but no? Not to say that it is hung like this, it has been modified in the container, will the host directory appear immediately?

The use of VOLUME in Dockerfile only declares a volume, that is, a mount point. For specific local mount, you need to specify the local directory to mount to the volume you have declared through -v at run time. Of course, Docker will automatically re-create the undeclared volume.