Skip to content

Commit 010d814

Browse files
authored
Cleaner way to wait for vc_redist installation to finish
Rather than waiting an arbitrary amout of time, we can use the Start-Process cmdlet and tell it to wait for the process to finish. I've used this with other Dockerfiles, including ones with msiexec commands, and it seems to do the job !
1 parent 56067e4 commit 010d814

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

php/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ ENV PHP_SHA1 85c0215337b08f9d49c233c16475c15f17b66ac1
88
WORKDIR /Users/ContainerAdministrator/Downloads
99

1010
# Visual C++ 2015 Redistributable
11-
# workaround: the .exe command completes early and does not finish the install, so added 10s sleep to the end to allow time to finish
1211
RUN Invoke-WebRequest 'https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe' -OutFile 'vc_redist.x64.exe'; \
13-
.\vc_redist.x64.exe /install /passive /norestart; \
14-
Start-Sleep -s 10; \
12+
Start-Process '.\vc_redist.x64.exe' '/install /passive /norestart' -Wait; \
1513
Remove-Item vc_redist.x64.exe;
1614

1715
# Install PHP

0 commit comments

Comments
 (0)