首页 > 解决方案 > 在 Docker 上构建 mssql-server-windows-express 时出错

问题描述

平台为 Windows Server 2019

Docker 版本:4.0.0.0 (67817)

Docker 引擎:v20.10.8

从以下 URL 下载 Dockerfile:

https://github.com/microsoft/mssql-docker/tree/master/windows/mssql-server-windows-express

我们已将基本映像从“microsoft/windowsservercore”替换为“mcr.microsoft.com/windows/servercore:ltsc2019”

重现步骤:

  1. 以管理员身份打开 PowerShell
  2. 执行 docker build 命令

Docker 构建 -t sql-express 。

执行 setup.exe 文件时,它会引发错误,如下图所示。

Step 8/10 : RUN Invoke-WebRequest -Uri $env:sql_express_download_url -OutFile sqlexpress.exe ;         Start-Process -Wait -FilePath .\sqlexpress.exe -ArgumentList /qs, /x:setup ;         .\setup\setup.exe /q /ACTION=Install /INSTANCENAME=SQLEXPRESS /FEATURES=SQLEngine /UPDATEENABLED=0 /SQLSVCACCOUNT='NT AUTHORITY\System' /SQLSYSADMINACCOUNTS='BUILTIN\ADMINISTRATORS' /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS ;         Remove-Item -Recurse -Force sqlexpress.exe, setup
 ---> Running in ab792bae7347
.\setup\setup.exe : The term '.\setup\setup.exe' is not recognized as the name
of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:232
+ ... qlexpress.exe -ArgumentList /qs, /x:setup ; .\setup\setup.exe /q /ACT ...
+                                                 ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.\setup\setup.exe:String) [], P
   arentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException

docker-mssql-express-error-image

标签: dockersql-server-express

解决方案


推荐阅读