Docker-compose overlapping volumes create an empty shadow file on Mac local filesystem

Information

When you have a docker-compose file that maps a single file into the same folder structure as another volume in the same container Docker for Mac ends up creating an empty file with the same name in the local folder.

See my repo here with steps to reproduce: https://github.com/jtwebman/docker-shadow-file-issue

  • macOS Version: 10.14.6
  • Docker for Mac: 2.1.0.4 (stable)

Has anyone else seen this issue before? Is there a work around to stop this?