简体   繁体   中英

Silent install inside Windows Docker container (NSIS)

For a project at our company we would like to create a Windows container to run a third-party application in the cloud. We use the docker images from this repo as base. The installer of the third-party application uses NSIS and supports silent install. Locally, I can run the installation successfully in powershell using:

Start-Process -FilePath <installer path> -ArgumentList '/S' -NoNewWindow -Wait -PassThru -RedirectStandardOutput output.txt -RedirectStandardError error.txt

I get a process ID reported for the separate process, and the shell blocks until the installation is complete. The stdout/stderr files are empty. When I run the same command inside docker, I again get a process ID for the separate process (all other stats columns are null, indicating no resources are used). The shell unblocks immediately. Again, the stdout and stderr files are empty.

Is there a better way to debug Start-Process commands? Any other hints to get more information on what is going wrong here?

EDIT

I verified this is unrelated to the specific third-party application or base image. The same occurs when using the following Dockerfile that install FileZilla. My host machine is Windows server 2019 (1809).

FROM mcr.microsoft.com/windows/servercore:ltsc2019

RUN powershell.exe -Command \
    $ErrorActionPreference = 'Stop'; \
    wget https://download.filezilla-project.org/client/FileZilla_3.48.0_win64_sponsored-setup.exe -OutFile C:\filezilla_setup.exe
RUN powershell.exe -Command \
    $ErrorActionPreference = 'Stop'; \
    Start-Process -FilePath C:\filezilla_setup.exe -ArgumentList '/S /NCRC' -NoNewWindow -Wait -PassThru
RUN powershell.exe -Command \
    $ErrorActionPreference = 'Stop'; \
    ls 'C:\\Program Files\\'
RUN powershell.exe -Command \
    $ErrorActionPreference = 'Stop'; \
    ls 'C:\\Program Files (x86)\\'

FileZilla cannot be found in Program Files after the install. Again, locally, FileZilla is present in C:\Program Files after running the same commands on my host machine.

For anyone that has a similar issue, it was documented on the Microsoft website . It can be resolved by installing the latest security updates and remove the base images in order to do a clean Docker install.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM