title: Why does the uid of files created in a docker bind mount differ based on the host OS?
body: <p>Running the following command creates a file <code>foo</code> in the current directory.</p>
  
  <pre><code>docker run --rm -v `pwd`:/workspace -w /workspace alpine:3.10.2 touch foo
  </code></pre>
  
  <p>On my Mac (macOS 10.14.6 (18G95), Docker version 19.03.2, build 6a30dfc), the created file is owned by "me" as confirmed by the output <code>ls -l foo</code>.</p>
  
  <pre><code>-rw-r--r--  1 till  staff  0 11 Sep 14:08 foo
  </code></pre>
  
  <p>However, on a workstation (Ubuntu 16.04.1, Docker version 19.03.2, build 6a30dfc), the created file is owned by <code>root</code>.</p>
  
  <pre><code>-rw-r--r-- 1 root root 0 Sep 11 13:32 foo
  </code></pre>
  
  <p>Do you know why the same command produces different results?</p>