SQL Server 2012在Windows容器中运行的Windows Server Core 2019上设置失败



我正试图在运行Windows Core Server 2019的Windows容器中安装SQL Server 2012 Developer Edition。我写了一个Dockerfile,并将SQL Server 2012安装文件复制到Docker构建上下文中(磁盘上4.94 GB(。我不希望在构建上下文中包含安装程序,但我没有可用的Web服务器来承载文件。当我运行setup.exe时,我没有看到指示失败的诊断消息,但日志文件SqlSetup.log在文件末尾包含消息"安装程序已关闭,退出代码为:0x84C40013"。

这是我的Dockerfile:

# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
# Before doing a Docker build, copy the following folder from \filesrv01SoftwareDatabasesAll Database SoftwareMicrosoft ...
COPY en_sql_server_2012_developer_edition_x86_x64_dvd_813280/ C:sql_server_2012
# Copy script to set up SQL Server
COPY set-up-sql-server.cmd C:

以下是我的SQL Server 2012安装脚本set-up-SQL-Server.cmd:

C:sql_server_2012setup.exe /q /ACTION=Install /FEATURES=SQLEngine /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="NT AUTHORITYNetwork Service" /SQLSYSADMINACCOUNTS="NT AUTHORITYNetwork Service" /AGTSVCACCOUNT="NT AUTHORITYNetwork Service" /IACCEPTSQLSERVERLICENSETERMS

以下是我的PowerShell会话摘录:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:UsersmmoreyDocumentsgitdocker-mssql2012> docker run --interactive --tty mssql-2012
Microsoft Windows [Version 10.0.17763.1040]
(c) 2018 Microsoft Corporation. All rights reserved.
C:>set-up-sql-server.cmd
C:>C:sql_server_2012setup.exe /q /ACTION=Install /FEATURES=SQLEngine /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="NT AUTHORITYNetwo
rk Service" /SQLSYSADMINACCOUNTS="NT AUTHORITYNetwork Service" /AGTSVCACCOUNT="NT AUTHORITYNetwork Service" /IACCEPTSQLSERVERLICEN
SETERMS
Microsoft (R) SQL Server 2012 11.00.2100.60
Copyright (c) Microsoft Corporation.  All rights reserved.
Microsoft .NET Framework CasPol 4.7.3190.0
for Microsoft .NET Framework version 4.7.3190.0
Copyright (C) Microsoft Corporation.  All rights reserved.
WARNING: The .NET Framework does not apply CAS policy by default. Any settings shown or modified by CasPol will only affect
applications that opt into using CAS policy.
Please see http://go.microsoft.com/fwlink/?LinkId=131738 for more information.

Success
Microsoft .NET Framework CasPol 4.7.3190.0
for Microsoft .NET Framework version 4.7.3190.0
Copyright (C) Microsoft Corporation.  All rights reserved.
WARNING: The .NET Framework does not apply CAS policy by default. Any settings shown or modified by CasPol will only affect
applications that opt into using CAS policy.
Please see http://go.microsoft.com/fwlink/?LinkId=131738 for more information.

Success
C:>cd Users
C:Users>dir *.log /s
Volume in drive C has no label.
Volume Serial Number is E4BB-38D4
Directory of C:UsersAll UsersMicrosoftWindowsWERReportQueueCritical_10.0.17763.850_464a773e8edf25185cd88a761afde13fe6f97325_
00000000_cab_0199d07a
03/02/2020  11:25 AM         1,227,459 CBS.log
1 File(s)      1,227,459 bytes
Directory of C:UsersContainerAdministratorAppDataLocalTemp
03/02/2020  11:27 AM           102,216 SqlSetup.log
1 File(s)        102,216 bytes
Total Files Listed:
2 File(s)      1,329,675 bytes
0 Dir(s)  19,351,437,312 bytes free
C:Users>more C:UsersContainerAdministratorAppDataLocalTempSqlSetup.log
03/02/2020 11:23:38.007 ======================================================================
03/02/2020 11:23:38.007 Setup launched
03/02/2020 11:23:38.007 Attempting to determine media source
03/02/2020 11:23:38.007 Media source value not specified on command line argument.
03/02/2020 11:23:38.022 Setup is launched from media directly so default the value to the current folder.
03/02/2020 11:23:38.022 Media source: C:sql_server_2012
03/02/2020 11:23:38.022 Attempt to determine media layout based on file 'C:sql_server_2012mediainfo.xml'.
03/02/2020 11:23:38.241 Media layout is detected as: Full
03/02/2020 11:23:38.241 Not a slip stream media, so continuing to run setup.exe from media.
03/02/2020 11:23:38.257 SQM key not found
03/02/2020 11:23:38.257 /? or /HELP or /ACTION=HELP specified: false
03/02/2020 11:23:38.257 Help display: false
03/02/2020 11:23:38.257 Server-Gui-Mgmt: 0, Server-Gui-Shell: 0
03/02/2020 11:23:38.272 .Net version 4.0 is installed
03/02/2020 11:23:38.272 Local setup.exe not found, so continuing to run setup.exe from media.
03/02/2020 11:23:38.272 Attempt to initialize SQL setup code group
03/02/2020 11:23:38.272 Attempting to determine security.config file path
03/02/2020 11:23:38.272 Checking to see if policy file exists C:WindowsMicrosoft.NETFramework64v4.0.30319\CONFIGsecurity.confi
g
03/02/2020 11:23:38.289 .Net security policy file does not exist
03/02/2020 11:23:38.289 Attempting to create .Net security policy file
03/02/2020 11:23:39.795 Attempting to load .Net security policy file
.
.
.
03/02/2020 11:23:40.078 Saved .Net security policy file
03/02/2020 11:23:40.078 Attempting to determine security.config file path
03/02/2020 11:23:40.078 Checking to see if policy file exists  C:WindowsMicrosoft.NETFrameworkv4.0.30319\CONFIGsecurity.config
03/02/2020 11:23:40.095 .Net security policy file does not exist
03/02/2020 11:23:40.095 Attempting to create .Net security policy file
03/02/2020 11:23:41.588 Attempting to load .Net security policy file
.
.
.
03/02/2020 11:23:41.691 Saved .Net security policy file
03/02/2020 11:23:41.726 Strong name verification disabling is not required
03/02/2020 11:23:41.726 /? or /HELP or /ACTION=HELP specified: false
03/02/2020 11:23:41.726 Help display: false
03/02/2020 11:23:41.726 Attempting to launch landing page workflow
03/02/2020 11:23:41.726 Attempting to set setup mutex
03/02/2020 11:23:41.726 Setup mutex has been set
03/02/2020 11:23:41.726 Attempting to launch global rules workflow
03/02/2020 11:23:41.726 Media source: C:sql_server_2012
03/02/2020 11:23:41.741 Install media path: C:sql_server_2012x64setup
03/02/2020 11:23:41.743 Media layout: Full
03/02/2020 11:23:41.743 Attempting to get execution timestamp
03/02/2020 11:23:41.743 Timestamp: 20200302_112338
03/02/2020 11:23:41.743 Attempting to run workflow RUNRULES /RULES=GlobalRules
03/02/2020 11:23:41.743 Attempting to launch process C:sql_server_2012x64ScenarioEngine.exe
03/02/2020 11:23:49.445 Process returned exit code: 0x00000000
03/02/2020 11:23:49.461 Workflow RUNRULES /RULES=GlobalRules returned exit code: 0x00000000
03/02/2020 11:23:49.461 Attempting to launch component update workflow
03/02/2020 11:23:49.461 Media source: C:sql_server_2012
03/02/2020 11:23:49.461 Install media path: C:sql_server_2012x64setup
03/02/2020 11:23:49.461 Media layout: Full
03/02/2020 11:23:49.461 Attempting to get execution timestamp
03/02/2020 11:23:49.461 Timestamp: 20200302_112338
03/02/2020 11:23:49.476 Attempting to run workflow COMPONENTUPDATE
03/02/2020 11:23:49.476 Attempting to launch process C:sql_server_2012x64ScenarioEngine.exe
03/02/2020 11:24:59.261 Process returned exit code: 0x00000000
03/02/2020 11:24:59.272 Workflow COMPONENTUPDATE returned exit code: 0x00000000
03/02/2020 11:24:59.272 Attempting to launch user requested workflow locally
03/02/2020 11:24:59.272 Attempting to find local setup.exe
03/02/2020 11:24:59.272 Local bootstrap folder path: C:Program FilesMicrosoft SQL Server110Setup Bootstrap
03/02/2020 11:24:59.286 Local ScenarioEngine.exe full path: C:Program FilesMicrosoft SQL Server110Setup BootstrapSQLServer2012
x64ScenarioEngine.exe
03/02/2020 11:24:59.286 Media source: C:sql_server_2012
03/02/2020 11:24:59.286 Install media path: C:sql_server_2012x64setup
03/02/2020 11:24:59.286 Media layout: Full
03/02/2020 11:24:59.302 Attempting to get execution timestamp
03/02/2020 11:24:59.302 Timestamp: 20200302_112338
03/02/2020 11:24:59.302 Attempting to run user requested action from local ScenarioEngine.exe
03/02/2020 11:24:59.302 Attempting to launch process C:Program FilesMicrosoft SQL Server110Setup BootstrapSQLServer2012x64Sce
narioEngine.exe
03/02/2020 11:27:42.901 Process returned exit code: 0x85940001
03/02/2020 11:27:42.917 Local ScenarioEngine.exe returned exit code: 0x85940001
03/02/2020 11:27:42.949 Attempting to load .Net security policy file C:WindowsMicrosoft.NETFramework64v4.0.30319\CONFIGsecurit
y.config
03/02/2020 11:27:43.045 Attempting to remove .Net security code group node
.
.
.
03/02/2020 11:27:44.682 Saved .Net security policy file
03/02/2020 11:27:44.682 Attempting to release setup mutex
03/02/2020 11:27:44.698 Setup mutex has been released
03/02/2020 11:27:44.698 Setup closed with exit code: 0x84C40013
03/02/2020 11:27:44.698 ======================================================================
C:Users>

没有具体的消息来指示安装失败的性质,也没有要采取的步骤。

我通过更改Dockerfile FROM指令以切换到Microsoft.NET 3.5 Framework SDK/Server Core 2019映像来解决此问题:

FROM mcr.microsoft.com/dotnet/framework/sdk:3.5-20191008-windowsservercore-ltsc2019

这是因为Microsoft SQL Server 2012需要Microsoft.NET 3.5 Framework SDK作为先决条件。

SQL Server 2012的推荐操作系统是Windows Server 2012 R2。SQL Server 2012与Windows Server 2019不兼容。以下是安装要求的链接:

https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2012/ms143506(v=sql.110(?重定向自=MSDN

此外,以下链接显示Windows Server 2019支持哪些版本的SQL Server:

https://learn.microsoft.com/en-us/windows-server/get-started-19/app-compat-19

最新更新