Skip to content

Commit 3fc6093

Browse files
authored
Windows: swap install order for python and VSB (#362)
Supposedly the ordering matters and reduces the size by ~900M.
1 parent c8e240c commit 3fc6093

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

5.9/windows/LTSC2022/Dockerfile

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,43 @@ RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:GIT});
5151
Remove-Item -Force git.exe; \
5252
Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\*
5353

54+
# Install Python
55+
ARG PY39=https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe
56+
ARG PY39_SHA256=FB3D0466F3754752CA7FD839A09FFE53375FF2C981279FD4BC23A005458F7F5D
57+
RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:PY39}); \
58+
Invoke-WebRequest -Uri ${env:PY39} -OutFile python-3.9.13-amd64.exe; \
59+
Write-Host '✓'; \
60+
Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:PY39_SHA256});\
61+
$Hash = Get-FileHash python-3.9.13-amd64.exe -Algorithm sha256; \
62+
if ($Hash.Hash -eq ${env:PY39_SHA256}) { \
63+
Write-Host '✓'; \
64+
} else { \
65+
Write-Host ('✘ ({0})' -f $Hash.Hash); \
66+
exit 1; \
67+
} \
68+
Write-Host -NoNewLine 'Installing Python ... '; \
69+
$Process = \
70+
Start-Process python-3.9.13-amd64.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \
71+
'AssociateFiles=0', \
72+
'Include_doc=0', \
73+
'Include_debug=0', \
74+
'Include_lib=1', \
75+
'Include_tcltk=0', \
76+
'Include_test=0', \
77+
'InstallAllUsers=1', \
78+
'InstallLauncherAllUsers=0', \
79+
'PrependPath=1', \
80+
'/quiet' \
81+
); \
82+
if ($Process.ExitCode -eq 0) { \
83+
Write-Host '✓'; \
84+
} else { \
85+
Write-Host ('✘ ({0})' -f $Process.ExitCode); \
86+
exit 1; \
87+
} \
88+
Remove-Item -Force python-3.9.13-amd64.exe; \
89+
Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\*
90+
5491
# Install Visual Studio Build Tools
5592
ARG VSB=https://aka.ms/vs/17/release/vs_buildtools.exe
5693
ARG VSB_SHA256=D4E08524CB0E5BD061A24F507928D1CFB91DCE192C5E12ED964B8343FC4CDEDD
@@ -112,43 +149,6 @@ RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:SWIFT});
112149
Remove-Item -Force installer.exe; \
113150
Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\*
114151

115-
# Install Python
116-
ARG PY39=https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe
117-
ARG PY39_SHA256=FB3D0466F3754752CA7FD839A09FFE53375FF2C981279FD4BC23A005458F7F5D
118-
RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:PY39}); \
119-
Invoke-WebRequest -Uri ${env:PY39} -OutFile python-3.9.13-amd64.exe; \
120-
Write-Host '✓'; \
121-
Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:PY39_SH256}); \
122-
$Hash = Get-FileHash python-3.9.13-amd64.exe -Algorithm sha256; \
123-
if ($Hash.Hash -eq ${env:PY39_SHA256}) { \
124-
Write-Host '✓'; \
125-
} else { \
126-
Write-Host ('✘ ({0})' -f $Hash.Hash); \
127-
exit 1; \
128-
} \
129-
Write-Host -NoNewLine 'Installing Python ... '; \
130-
$Process = \
131-
Start-Process python-3.9.13-amd64.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \
132-
'AssociateFiles=0', \
133-
'Include_doc=0', \
134-
'Include_debug=0', \
135-
'Include_lib=1', \
136-
'Include_tcltk=0', \
137-
'Include_test=0', \
138-
'InstallAllUsers=1', \
139-
'InstallLauncherAllUsers=0', \
140-
'PrependPath=1', \
141-
'/quiet' \
142-
); \
143-
if ($Process.ExitCode -eq 0) { \
144-
Write-Host '✓'; \
145-
} else { \
146-
Write-Host ('✘ ({0})' -f $Process.ExitCode); \
147-
exit 1; \
148-
} \
149-
Remove-Item -Force python-3.9.13-amd64.exe; \
150-
Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\*
151-
152152
# Default to powershell
153153
# FIXME: we need to grant ContainerUser the SeCreateSymbolicLinkPrivilege
154154
# privilege so that it can create symbolic links.

0 commit comments

Comments
 (0)