If a directory is volume mounted, all changes on the host should by visible in the docker container.
If a directory within the mounted volume is deleted, then re-created with the same name, docker no longer sees the directory contents and cannot write to the directory any more.
Diagnostic ID CEE8ECF6-5316-463D-B341-019235307AC5
Host MacBook Pro OSX Version 10.11.5
Steps to reproduce the behavior
- Volume mount a directory containing another directory e.f /Users/bob containing /temp
e.g: docker run -d -p 2022:22 --privileged=true -v /Users/bob:/Users/bob docker-image-name
- Create a file in the directory to check its all working e.g. /Users/bob/temp/test.txt
- Navigate to this temp directory in docker and list the contents
- Delete the temp directory on the Host, then recreate it
- On the host, create another file in the directory e.g. /Users/bob/temp/another.txt
- List the contents of /Users/bob/temp on the docker container - now shows as an empty directory