title: Unable to bind mount a Windows folder in a Linux SQL Server docker image
body: <p>I'm trying to run the docker image mcr.microsoft.com/mssql/server:2019-latest on a windows host.</p>
  
  <p>When running this command line, everything works fine:</p>
  
  <pre><code>docker run --rm -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=My_Password" -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest
  </code></pre>
  
  <p>When I try to bind mount the /var/opt/mssql/data folder to access it's content from my windows host, I get the following error:</p>
  
  <pre><code>PS C:\Docker&gt; docker run --rm -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=My_Password" -v C:\SQL\data:/var/opt/mssql/data -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest
  SQL Server 2019 will run as non-root by default.
  This container is running as user mssql.
  To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
  2020-05-13 20:39:01.91 Server      Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.
  2020-05-13 20:39:01.99 Server      ERROR: Setup FAILED copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf':  31(A device attached to the system is not functioning.)
  ERROR: BootstrapSystemDataDirectories() failure (HRESULT 0x8007001f)
  </code></pre>
  
  <p>It looks like this issue: <a href="https://support.microsoft.com/en-us/help/4212960/fix-sql-server-2017-won-t-start-with-linux-container-image-on-docker" rel="nofollow noreferrer">https://support.microsoft.com/en-us/help/4212960/fix-sql-server-2017-won-t-start-with-linux-container-image-on-docker</a>
  Which is supposed to be fixed. But I tried with several version of the docker image, including mcr.microsoft.com/mssql/server:2017-CU7-ubuntu, which is supposed to be the version in which that issue was fixed.</p>