I'm having a hard time installing an msi via Dockerfile. My Dockerfile:
FROM microsoft/windowsservercore:latest
RUN mkdir C:\temp
RUN mkdir C:\temp\msis
COPY . "C:/temp/msis"
RUN powershell -version 5.0 -command { Start-process -Filepath "C:\temp\msis\mySetup.msi" -ArgumentList "/qn" -PassThru | Wait-Process}
When running docker build via:
docker build -t myTools .
I get the following error:
Step 7/7 : RUN powershell -version 5.0 -command { Start-process -Filepath "C:\temp\msis\mySetup.msi" -ArgumentList "/qn" -PassThru | Wait-Process}
---> Running in d6f9f65d96a9
'Wait-Process}' is not recognized as an internal or external command,operable program or batch file.
If I build the container without the RUN step, and attach myself via -it
to the running container and paste the command powershell -version 5.0 -command { Start-process -Filepath "C:\temp\msis\mySetup.msi" -ArgumentList "/qn" -PassThru | Wait-Process}
the MSI gets installed correctly.
Has anyone an idea this failure happens?
Thx
Possibly it's a PowerShell parsing problem.
Try these 2 lines instead of your last line:
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Start-Process 'C:\\temp\\msis\\mySetup.msi' '/qn' -PassThru | Wait-Process;
After that you can revert to cmd.exe if you wish:
SHELL ["cmd", "/C"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With