8000 Add Windows Server 2022 images for 3.9 and 3.10-rc · daiyiy/python@daf9e7d · GitHub
[go: up one dir, main page]

Skip to content

Commit daf9e7d

Browse files
author
Paul "Hampy" Hampson
committed
Add Windows Server 2022 images for 3.9 and 3.10-rc
Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>
1 parent bb70f32 commit daf9e7d

File tree

4 files changed

+166
-2
lines changed

4 files changed

+166
-2
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM mcr.microsoft.com/windows/servercore:ltsc2022
8+
9+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
10+
11+
# https://github.com/docker-library/python/pull/557
12+
ENV PYTHONIOENCODING UTF-8
13+
14+
ENV PYTHON_VERSION 3.10.0rc1
15+
ENV PYTHON_RELEASE 3.10.0
16+
17+
RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \
18+
Write-Host ('Downloading {0} ...' -f $url); \
19+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
20+
Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \
21+
\
22+
Write-Host 'Installing ...'; \
23+
# https://docs.python.org/3/using/windows.html#installing-without-ui
24+
$exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \
25+
-ArgumentList @( \
26+
'/quiet', \
27+
'InstallAllUsers=1', \
28+
'TargetDir=C:\Python', \
29+
'PrependPath=1', \
30+
'Shortcuts=0', \
31+
'Include_doc=0', \
32+
'Include_pip=0', \
33+
'Include_test=0' \
34+
) \
35+
).ExitCode; \
36+
if ($exitCode -ne 0) { \
37+
Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \
38+
Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \
39+
exit $exitCode; \
40+
} \
41+
\
42+
# the installer updated PATH, so we should refresh our local value
43+
$env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \
44+
\
45+
Write-Host 'Verifying install ...'; \
46+
Write-Host ' python --version'; python --version; \
47+
\
48+
Write-Host 'Removing ...'; \
49+
Remove-Item python.exe -Force; \
50+
Remove-Item $env:TEMP/Python*.log -Force; \
51+
\
52+
Write-Host 'Complete.'
53+
54+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
55+
ENV PYTHON_PIP_VERSION 21.2.4
56+
# https://github.com/pypa/get-pip
57+
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/c20b0cfd643cd4a19246ccf204e2997af70f6b21/public/get-pip.py
58+
ENV PYTHON_GET_PIP_SHA256 fa6f3fb93cce234cd4e8dd2beb54a51ab9c247653b52855a48dd44e6b21ff28b
59+
60+
RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \
61+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
62+
Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \
63+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \
64+
if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \
65+
Write-Host 'FAILED!'; \
66+
exit 1; \
67+
}; \
68+
\
69+
Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \
70+
python get-pip.py \
71+
--disable-pip-version-check \
72+
--no-cache-dir \
73+
('pip=={0}' -f $env:PYTHON_PIP_VERSION) \
74+
; \
75+
Remove-Item get-pip.py -Force; \
76+
\
77+
Write-Host 'Verifying pip install ...'; \
78+
pip --version; \
79+
\
80+
Write-Host 'Complete.'
81+
82+
CMD ["python"]
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM mcr.microsoft.com/windows/servercore:ltsc2022
8+
9+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
10+
11+
# https://github.com/docker-library/python/pull/557
12+
ENV PYTHONIOENCODING UTF-8
13+
14+
ENV PYTHON_VERSION 3.9.6
15+
ENV PYTHON_RELEASE 3.9.6
16+
17+
RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \
18+
Write-Host ('Downloading {0} ...' -f $url); \
19+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
20+
Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \
21+
\
22+
Write-Host 'Installing ...'; \
23+
# https://docs.python.org/3/using/windows.html#installing-without-ui
24+
$exitCode = (Start-Process python.exe -Wait -NoNewWindow -PassThru \
25+
-ArgumentList @( \
26+
'/quiet', \
27+
'InstallAllUsers=1', \
28+
'TargetDir=C:\Python', \
29+
'PrependPath=1', \
30+
'Shortcuts=0', \
31+
'Include_doc=0', \
32+
'Include_pip=0', \
33+
'Include_test=0' \
34+
) \
35+
).ExitCode; \
36+
if ($exitCode -ne 0) { \
37+
Write-Host ('Running python installer failed with exit code: {0}' -f $exitCode); \
38+
Get-ChildItem $env:TEMP | Sort-Object -Descending -Property LastWriteTime | Select-Object -First 1 | Get-Content; \
39+
exit $exitCode; \
40+
} \
41+
\
42+
# the installer updated PATH, so we should refresh our local value
43+
$env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \
44+
\
45+
Write-Host 'Verifying install ...'; \
46+
Write-Host ' python --version'; python --version; \
47+
\
48+
Write-Host 'Removing ...'; \
49+
Remove-Item python.exe -Force; \
50+
Remove-Item $env:TEMP/Python*.log -Force; \
51+
\
52+
Write-Host 'Complete.'
53+
54+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
55+
ENV PYTHON_PIP_VERSION 21.2.4
56+
# https://github.com/pypa/get-pip
57+
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/c20b0cfd643cd4a19246ccf204e2997af70f6b21/public/get-pip.py
58+
ENV PYTHON_GET_PIP_SHA256 fa6f3fb93cce234cd4e8dd2beb54a51ab9c247653b52855a48dd44e6b21ff28b
59+
60+
RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \
61+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
62+
Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \
63+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \
64+
if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \
65+
Write-Host 'FAILED!'; \
66+
exit 1; \
67+
}; \
68+
\
69+
Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \
70+
python get-pip.py \
71+
--disable-pip-version-check \
72+
--no-cache-dir \
73+
('pip=={0}' -f $env:PYTHON_PIP_VERSION) \
74+
; \
75+
Remove-Item get-pip.py -Force; \
76+
\
77+
Write-Host 'Verifying pip install ...'; \
78+
pip --version; \
79+
\
80+
Write-Host 'Complete.'
81+
82+
CMD ["python"]

generate-stackbrew-library.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ for version in "${versions[@]}"; do
8080
for v in \
8181
{bullseye,buster}{,/slim} \
8282
alpine{3.14,3.13} \
83-
windows/windowsservercore-{1809,ltsc2016} \
83+
windows/windowsservercore-{ltsc2022,1809,ltsc2016} \
8484
; do
8585
dir="$version/$v"
8686
variant="$(basename "$v")"

update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ for version in "${versions[@]}"; do
134134
for v in \
135135
alpine{3.14,3.13} \
136136
{buster,bullseye}{/slim,} \
137-
windows/windowsservercore-{1809,ltsc2016} \
137+
windows/windowsservercore-{ltsc2022,1809,ltsc2016} \
138138
; do
139139
dir="$version/$v"
140140
variant="$(basename "$v")"

0 commit comments

Comments
 (0)
0