Docker Community Forums

Share and learn in the Docker community.

Windows docker container not able to install any msi files

I spun up a container on my server 2019 machine using below command.

docker run -it -v c:\data:c:\shareddata mcr.microsoft.com/windows/servercore:ltsc2019 powershell

All the installers are failing, when I check the log file, I came to know windows installer service not running inside container.

But, starting it, get below error.

Set-Service –Name msiserver –StartupType "Manual"

Set-Service : Service ‘Windows Installer (msiserver)’ cannot be configured due to the following error: Access is denied
At line:1 char:1

  • Set-Service –Name msiserver –StartupType “Manual”
  • CategoryInfo : PermissionDenied: (System.ServiceProcess.ServiceController:ServiceController) [Set-Servi
    ce], ServiceCommandException
  • FullyQualifiedErrorId : CouldNotSetService,Microsoft.PowerShell.Commands.SetServiceCommand

whoami

user manager\containeradministratorIf I try direct installation of an msi, getting this error in the log.

Error 1719. Windows Installer service could not be accessed. Contact
your support personnel to verify that it is properly registered and
enabled.

I tried from the steps mentioned in this link

I am still getting the msi 1719 error.

Content from my msi log:
Error 1719. Windows Installer service co
uld not be accessed. Contact your support personnel to verify that it is properly registered and enabled

My docker file:

# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]


WORKDIR c:\shareddata
COPY data c:\shareddata


RUN [Net.ServicePointManager]::SecurityProtocol = 'Tls12, Tls11, Tls' 

RUN ls
RUN Start-Process 'vcredist_x64.exe' '/q /norestart' -PassThru | Wait-Process;
RUN Start-Process 'VC_redist.x64.exe' '/q /norestart' -PassThru | Wait-Process;
RUN Start-Process 'rktools.msi' '/qn /norestart /L*V "rktools.msi.log"' -PassThru | Wait-Process;

RUN get-process

SHELL ["cmd", "/S", "/C"]

I have had similar issues. Typically we get the MSI aborting with error 1603 or 1609. I definitely got further when I manually installed the VC++ runtime, but that was not required prior to applying some Windows updates. I also updated the docker enterprise engine, and that resolved it on some machines but not others. Very strange.

I’ve done similar work 2 years ago, dockerizing some C# code we had in our organisation.
Here’s a snippet from one of the Dockerfile that should help you achieve what you are trying to do -

FROM microsoft/windowsservercore

SHELL [“powershell”, “-Command”, “$ErrorActionPreference = ‘Stop’; $ProgressPreference = ‘SilentlyContinue’;”]

#Copy installers
RUN (New-Object System.Net.WebClient).DownloadFile(‘https://download.microsoft.com/download/B/4/A/B4A8422F-C564-4393-80DA-6865A8C4B32D/MicrosoftAzureAuthoringTools-x64.msi’, ‘c:\tools\MicrosoftAzureAuthoringTools-x64.msi’) ;
(New-Object System.Net.WebClient).DownloadFile(‘https://download.microsoft.com/download/B/4/A/B4A8422F-C564-4393-80DA-6865A8C4B32D/MicrosoftAzureLibsForNet-x64.msi’, ‘c:\tools\MicrosoftAzureLibsForNet-x64.msi’) ;
Start-Process ‘msiexec’ -ArgumentList ‘/i c:\tools\MicrosoftAzureAuthoringTools-x64.msi /quiet /qn /norestart /log c:\tools\installAuth.log’;
Start-Sleep -s 30 ;
Start-Process ‘msiexec’ -ArgumentList ‘/i c:\tools\MicrosoftAzureLibsForNet-x64.msi /quiet /qn /norestart /log c:\tools\installLib.log’;
Start-Sleep -s 30 ;
Remove-Item c:\tools*.msi -force
My example downloads the files from the internet, then installs it from the c:\tools folder to which they were downloaded to, but it should work just as well and also eliminates dependency on files existing on the host machine.
Hope it helps.