title: The same file on host and inside container is different, it is not in sync with its original
body: <p>I've faced a weird problem: I mount a file from a host to a container in RW mode, then I edit this file on the host but it's not get updated in the container. </p>
  
  <p>This is an extract from <code>docker inspect &lt;container&gt;</code>'s output:</p>
  
  <pre><code>"Mounts": [
      ...
      {
          "Type": "bind",
          "Source": "/home/a_user/projects/drupal/d8-default/composer.json",
          "Destination": "/var/www/d8-default/composer.json",
          "Mode": "rw",
          "RW": true,
          "Propagation": ""
      },
      ...
  ]
  </code></pre>
  
  <p>As you may see, the file is mounted as read-write mode as a separate mount. Now when I edit it on the host, it doesn't get changed in the container. I see this by logging into the container and doing simple <code>cat composer.json</code> there and outside of it.</p>
  
  <p>I've performed additional tests with random files and here is what I discovered:</p>
  
  <ol>
  <li><p>If a file being edited is located in a directory (which is mounted in RW mode) then changes immediately appear in its container's copy.</p></li>
  <li><p>If a file is mounted directly then changes are not transferred at all, it seems like the container is maintaining its own version of the file!</p></li>
  </ol>
  
  <p>Indeed it is highly undesired behavior, it breaks my workflows and I haven't found a solution to overcome this disalignment yet. Any suggestions are welcome.</p>