My expectation is that with a bind mount file modifications on the host machine are reflected in the container with the bind mount. This appears to not be working with docker on windows. I have not yet been able to find other reports on this issue. Can anyone shed any light on this issue?
The script below loops and cats a file repeatedly. If the file C:\work\testfile.txt is modified, I would expect the updates to show 3 seconds later with the next cat. However, this does not occur. In fact, the content of c:\work\testfile.txt seems locked in until a docker restart. It is not sufficient to run this command again.
docker run --mount type=bind,source=/,target=/mnt/external alpine sh -c "for i in 1 2 3 4 5 6 7 8 9 0 10 11 12 13 14 15 16 17 18; do sleep 3; cat /mnt/external/host_mnt/c/work/testfile.txt; done"
Version info:
Windows 10 Pro 1909 OS build 18363.720
Docker Engine v19.03.8