[英]Unable to bind mount a Windows folder in a Linux SQL Server docker image
I'm trying to run the docker image mcr.microsoft.com/mssql/server:2019-latest on a windows host.我正在尝试在 windows 主机上运行 docker 映像 mcr.microsoft.com/mssql/server:2019-latest。
When running this command line, everything works fine:运行此命令行时,一切正常:
docker run --rm -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=My_Password" -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest
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:当我尝试绑定挂载 /var/opt/mssql/data 文件夹以从我的 windows 主机访问它的内容时,我收到以下错误:
PS C:\Docker> 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)
It looks like this issue: https://support.microsoft.com/en-us/help/4212960/fix-sql-server-2017-won-t-start-with-linux-container-image-on-docker Which is supposed to be fixed.看起来像这个问题: https://support.microsoft.com/en-us/help/4212960/fix-sql-server-2017-won-t-start-with-linux-container-image-on-docker哪个应该是固定的。 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.
但我尝试了几个版本的 docker 映像,包括 mcr.microsoft.com/mssql/server:2017-CU7-ubuntu,它应该是修复该问题的版本。
It seems to be an issue in the new Docker for Windows version.这似乎是 Windows 版本的新 Docker 中的问题。 I did rollback from 2.3.0.2 to 2.2.0.5, and now the bind mount works as expected.
我确实从 2.3.0.2 回滚到 2.2.0.5,现在绑定挂载按预期工作。
An issue has been raised about it in the mssql-docker github: https://github.com/microsoft/mssql-docker/issues/600在 mssql-docker github: https://github.com/microsoft/mssql-docker/issues/600中提出了一个关于它的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.