I am trying to get Microsoft Excel working from within a Docker Windows container. The purpose of this container is to run an Excel workbook with VBA code that essentially runs a batch process. However, I have been unable to get Excel successfully installed in the container.
To install Excel in a controlled manner, I have resorted to the following partially manual process:
- Build a Docker image with the following Dockerfile:
FROM mcr.microsoft.com/windows/servercore:ltsc2019 AS build
WORKDIR C:\\odtsetup
COPY odtsetup.exe C:\\odtsetup
RUN odtsetup.exe /quiet /norestart /extract:C:\\odtsetup
- Run the image interactively with:
docker run -it IMAGE cmd
- Manually execute the following Office Deployment Tool steps from a command prompt within the container:
setup.exe /download C:\\odtsetup\\configuration.xml
setup.exe /configure C:\\odtsetup\\configuration.xml
Here is the configuration.xml file:
<Configuration>
<Add OfficeClientEdition="64" Channel="PerpetualVL2019">
<Product ID="ProPlus2019Volume">
<Language ID="en-us" />
</Product>
</Add>
<Display Level="None" AcceptEULA="TRUE" />
<Property Name="AUTOACTIVATE" Value="1"/>
<Logging Level="Standard" Path="c:\logs" />
</Configuration>
The steps appear to run successfully to completion. However, Excel will not launch, and the ODT installation log for the ODT configure step reveals the following error:
|"C2R client returned failing error code","error code":"17002"
Also, inspecting the Registry reveals that numerous entries are missing. For example, the following command from Powershell does not return any results:
Get-ChildItem HKLM:\Software\Classes | Select-Object -ExpandProperty PSChildName | where-Object {$_ -eq 'Excel.Application'}
While searching the Web, I have seen other 17002 issues when trying to run MS Office apps in a container. I have not seen any solutions.
If I perform the exact same ODT installation steps on Windows 2019 Datacenter v1809, Excel installs without issue.
What is causing the 17002 error and how do I avoid this error and successfully install Excel in a Docker Windows container?