首页 > 解决方案 > 通过 Dockerfile 在 Windows Server 2019 中安装 Excel 返回非零错误代码 2147972583

问题描述

我正在尝试构建安装了 Excel 的 Windows Server 2019 的映像。下面是我的 Dockerfile

FROM mcr.microsoft.com/windows:1903

WORKDIR C:\deploy\

# Install Office deployment tool
ADD https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_12827-20268.exe C:/deploy/deploymenttool_autoextract.exe
RUN C:/deploy/deploymenttool_autoextract.exe /quiet /passive /extract:C:/deploy

COPY configuration.xml C:/deploy

# Download Office
RUN .\setup.exe /download configuration.xml
# Install Office
RUN .\setup.exe /configure configuration.xml

在 setup.exe /download configuration.xml 步骤中,返回非零错误代码 2147972583。我试图用谷歌搜索这样的错误代码,但似乎找不到任何东西。

下面是我的 configuration.xml,以防它出现问题:

<Configuration>

  <Add OfficeClientEdition="32" Channel="PerpetualVL2019">
    <Product ID="ProPlus2019Volume">
      <Language ID="en-us" />
    </Product>
  </Add>
  <!-- <RemoveMSI All="True" /> -->
  <Display Level="None" AcceptEULA="TRUE" />
  <Property Name="AUTOACTIVATE" Value="1" />
  <Logging Name="Setup.log" Path="C:\deploy" />

</Configuration>

感谢您提前提供任何帮助

标签: dockerdockerfilems-officewindows-server-2019

解决方案


我遇到了同样的问题 - 挖掘日志文件,我得到了 ServerReachabilityErrors。

{"MachineId": "b456094a29c44f4c9b0c17fb496209c3", "SessionID": "", "GeoID": 244, "Ver": "0.0.0.0", "C2RClientVer": "16.0.13231.20350", "ErrorCode": 30183, "ErrorType": "HttpTransportError", "AppVErrorSource": "", "ErrorMessage": "HttpTransportError (Sending Http GET request. Error: ServerReachabilityError (0x80072ee7) , Error:0x80072ee7)", "ErrorDetails": "", "ContextData": "{\"message\":\"Failed to connect\"}"}

这看起来像是防火墙设置的问题 - 特别是因为微软在放弃之前尝试了 20 个后备 cdn。如果你得到这个,检查防火墙日志,并确保运行 docker build 的机器有访问权限http://officecdn.microsoft.com/**


推荐阅读