我正在Docker容器中运行SQL Server示例。它在启动时自动退出。日志显示:
SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
Your master database file is owned by mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
sqlservr: Unable to read instance id from /var/opt/mssql/.system/instance_id: File: pal.cpp:438 [Status: 0xC0000034 Object name not found errno = 0x2(2) No such file or directory]
/opt/mssql/bin/sqlservr: PAL initialization failed. Error: 101
如果我没阅读的话,SQL Server不会以root用户身份运行。但是我的容器和卷都是以同一个非root用户身份运行的。所以我很困惑问题是从哪里来的。有人能帮我解码这个错误消息吗?
1条答案
按热度按时间laawzig21#
此错误可能是由于以错误的方式绑定sql server卷
/var/opt/mssql
造成的。例如
相反,请确保Map
/var/opt/mssql
的子卷关于问题https://www.herlitz.io/2022/12/22/sql-server-in-docker---palinstanceid-unable-to-read-instance-id-from-file/的更多细节