Skip to content

Commit 61f535a

Browse files
committed
Add "windowsservercore" variants
1 parent 2664a9b commit 61f535a

File tree

7 files changed

+225
-5
lines changed

7 files changed

+225
-5
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM microsoft/windowsservercore
8+
9+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
10+
11+
ENV PYTHON_VERSION 3.3.6
12+
ENV PYTHON_RELEASE 3.3.6
13+
ENV PYTHON_DOWNLOAD_URL https://www.python.org/ftp/python/${PYTHON_RELEASE}/python-${PYTHON_VERSION}-amd64.exe
14+
15+
# TODO PYTHON_PIP_VERSION ? (installer comes with pip, but not necessarily the latest version)
16+
17+
RUN Write-Host ('Downloading {0} ...' -f $env:PYTHON_DOWNLOAD_URL); \
18+
(New-Object System.Net.WebClient).DownloadFile($env:PYTHON_DOWNLOAD_URL, 'python.exe'); \
19+
\
20+
Write-Host 'Installing ...'; \
21+
# https://docs.python.org/3.5/using/windows.html#installing-without-ui
22+
Start-Process python.exe -Wait \
23+
-ArgumentList @( \
24+
'/quiet', \
25+
'InstallAllUsers=1', \
26+
'TargetDir=C:\Python', \
27+
'PrependPath=1', \
28+
'Shortcuts=0', \
29+
'Include_doc=0', \
30+
'Include_test=0' \
31+
); \
32+
\
33+
# the installer updated PATH, so we should refresh our local value
34+
$env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \
35+
\
36+
Write-Host 'Verifying install ...'; \
37+
Write-Host ' python --version'; python --version; \
38+
\
39+
Write-Host 'Removing ...'; \
40+
Remove-Item python.exe -Force; \
41+
\
42+
Write-Host 'Complete.';
43+
44+
CMD ["python"]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM microsoft/windowsservercore
8+
9+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
10+
11+
ENV PYTHON_VERSION 3.4.5
12+
ENV PYTHON_RELEASE 3.4.5
13+
ENV PYTHON_DOWNLOAD_URL https://www.python.org/ftp/python/${PYTHON_RELEASE}/python-${PYTHON_VERSION}-amd64.exe
14+
15+
# TODO PYTHON_PIP_VERSION ? (installer comes with pip, but not necessarily the latest version)
16+
17+
RUN Write-Host ('Downloading {0} ...' -f $env:PYTHON_DOWNLOAD_URL); \
18+
(New-Object System.Net.WebClient).DownloadFile($env:PYTHON_DOWNLOAD_URL, 'python.exe'); \
19+
\
20+
Write-Host 'Installing ...'; \
21+
# https://docs.python.org/3.5/using/windows.html#installing-without-ui
22+
Start-Process python.exe -Wait \
23+
-ArgumentList @( \
24+
'/quiet', \
25+
'InstallAllUsers=1', \
26+
'TargetDir=C:\Python', \
27+
'PrependPath=1', \
28+
'Shortcuts=0', \
29+
'Include_doc=0', \
30+
'Include_test=0' \
31+
); \
32+
\
33+
# the installer updated PATH, so we should refresh our local value
34+
$env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \
35+
\
36+
Write-Host 'Verifying install ...'; \
37+
Write-Host ' python --version'; python --version; \
38+
\
39+
Write-Host 'Removing ...'; \
40+
Remove-Item python.exe -Force; \
41+
\
42+
Write-Host 'Complete.';
43+
44+
CMD ["python"]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM microsoft/windowsservercore
8+
9+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
10+
11+
ENV PYTHON_VERSION 3.5.2
12+
ENV PYTHON_RELEASE 3.5.2
13+
ENV PYTHON_DOWNLOAD_URL https://www.python.org/ftp/python/${PYTHON_RELEASE}/python-${PYTHON_VERSION}-amd64.exe
14+
15+
# TODO PYTHON_PIP_VERSION ? (installer comes with pip, but not necessarily the latest version)
16+
17+
RUN Write-Host ('Downloading {0} ...' -f $env:PYTHON_DOWNLOAD_URL); \
18+
(New-Object System.Net.WebClient).DownloadFile($env:PYTHON_DOWNLOAD_URL, 'python.exe'); \
19+
\
20+
Write-Host 'Installing ...'; \
21+
# https://docs.python.org/3.5/using/windows.html#installing-without-ui
22+
Start-Process python.exe -Wait \
23+
-ArgumentList @( \
24+
'/quiet', \
25+
'InstallAllUsers=1', \
26+
'TargetDir=C:\Python', \
27+
'PrependPath=1', \
28+
'Shortcuts=0', \
29+
'Include_doc=0', \
30+
'Include_test=0' \
31+
); \
32+
\
33+
# the installer updated PATH, so we should refresh our local value
34+
$env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \
35+
\
36+
Write-Host 'Verifying install ...'; \
37+
Write-Host ' python --version'; python --version; \
38+
\
39+
Write-Host 'Removing ...'; \
40+
Remove-Item python.exe -Force; \
41+
\
42+
Write-Host 'Complete.';
43+
44+
CMD ["python"]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM microsoft/windowsservercore
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
4+
5+
ENV PYTHON_VERSION 3.6.0a3
6+
ENV PYTHON_RELEASE 3.6.0
7+
ENV PYTHON_DOWNLOAD_URL https://www.python.org/ftp/python/${PYTHON_RELEASE}/python-${PYTHON_VERSION}-amd64.exe
8+
9+
# TODO PYTHON_PIP_VERSION ? (installer comes with pip, but not necessarily the latest version)
10+
11+
RUN Write-Host ('Downloading {0} ...' -f $env:PYTHON_DOWNLOAD_URL); \
12+
(New-Object System.Net.WebClient).DownloadFile($env:PYTHON_DOWNLOAD_URL, 'python.exe'); \
13+
\
14+
Write-Host 'Installing ...'; \
15+
# https://docs.python.org/3.5/using/windows.html#installing-without-ui
16+
Start-Process python.exe -Wait \
17+
-ArgumentList @( \
18+
'/quiet', \
19+
'InstallAllUsers=1', \
20+
'TargetDir=C:\Python', \
21+
'PrependPath=1', \
22+
'Shortcuts=0', \
23+
'Include_doc=0', \
24+
'Include_test=0' \
25+
); \
26+
\
27+
# the installer updated PATH, so we should refresh our local value
28+
$env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \
29+
\
30+
Write-Host 'Verifying install ...'; \
31+
Write-Host ' python --version'; python --version; \
32+
\
33+
Write-Host 'Removing ...'; \
34+
Remove-Item python.exe -Force; \
35+
\
36+
Write-Host 'Complete.';
37+
38+
CMD ["python"]

Dockerfile-windowsservercore.template

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM microsoft/windowsservercore
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
4+
5+
ENV PYTHON_VERSION %%PLACEHOLDER%%
6+
ENV PYTHON_RELEASE %%PLACEHOLDER%%
7+
ENV PYTHON_DOWNLOAD_URL https://www.python.org/ftp/python/${PYTHON_RELEASE}/python-${PYTHON_VERSION}-amd64.exe
8+
9+
# TODO PYTHON_PIP_VERSION ? (installer comes with pip, but not necessarily the latest version)
10+
11+
RUN Write-Host ('Downloading {0} ...' -f $env:PYTHON_DOWNLOAD_URL); \
12+
(New-Object System.Net.WebClient).DownloadFile($env:PYTHON_DOWNLOAD_URL, 'python.exe'); \
13+
\
14+
Write-Host 'Installing ...'; \
15+
# https://docs.python.org/3.5/using/windows.html#installing-without-ui
16+
Start-Process python.exe -Wait \
17+
-ArgumentList @( \
18+
'/quiet', \
19+
'InstallAllUsers=1', \
20+
'TargetDir=C:\Python', \
21+
'PrependPath=1', \
22+
'Shortcuts=0', \
23+
'Include_doc=0', \
24+
'Include_test=0' \
25+
); \
26+
\
27+
# the installer updated PATH, so we should refresh our local value
28+
$env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \
29+
\
30+
Write-Host 'Verifying install ...'; \
31+
Write-Host ' python --version'; python --version; \
32+
\
33+
Write-Host 'Removing ...'; \
34+
Remove-Item python.exe -Force; \
35+
\
36+
Write-Host 'Complete.';
37+
38+
CMD ["python"]

generate-stackbrew-library.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,16 @@ for version in "${versions[@]}"; do
6767
Directory: $version
6868
EOE
6969

70-
for variant in slim alpine wheezy onbuild; do
71-
[ -f "$version/$variant/Dockerfile" ] || continue
70+
for v in \
71+
slim alpine wheezy onbuild \
72+
windows/windowsservercore windows/nanoserver \
73+
; do
74+
dir="$version/$v"
75+
variant="$(basename "$v")"
7276

73-
commit="$(dirCommit "$version/$variant")"
77+
[ -f "$dir/Dockerfile" ] || continue
78+
79+
commit="$(dirCommit "$dir")"
7480

7581
variantAliases=( "${versionAliases[@]/%/-$variant}" )
7682
variantAliases=( "${variantAliases[@]//latest-/}" )
@@ -79,7 +85,8 @@ for version in "${versions[@]}"; do
7985
cat <<-EOE
8086
Tags: $(join ', ' "${variantAliases[@]}")
8187
GitCommit: $commit
82-
Directory: $version/$variant
88+
Directory: $dir
8389
EOE
90+
[ "$variant" = "$v" ] || echo "Constraints: $variant"
8491
done
8592
done

update.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22
set -e
3+
shopt -s nullglob
34

45
declare -A gpgKeys=(
56
# gpg: key 18ADD4FF: public key "Benjamin Peterson <[email protected]>" imported
@@ -65,13 +66,16 @@ for version in "${versions[@]}"; do
6566
alpine \
6667
slim \
6768
onbuild \
69+
windows/windowsservercore \
6870
; do
6971
if [ "$variant" = 'debian' ]; then
7072
dir="$version"
7173
else
7274
dir="$version/$variant"
75+
variant="$(basename "$variant")"
7376
fi
7477
template="Dockerfile-$variant.template"
78+
mkdir -p "$dir"
7579
{ generated_warning; cat "$template"; } > "$dir/Dockerfile"
7680
done
7781
if [ -d "$version/wheezy" ]; then
@@ -84,9 +88,10 @@ for version in "${versions[@]}"; do
8488
sed -ri \
8589
-e 's/^(ENV GPG_KEY) .*/\1 '"${gpgKeys[$version]}"'/' \
8690
-e 's/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/' \
91+
-e 's/^(ENV PYTHON_RELEASE) .*/\1 '"${fullVersion%%[a-z]*}"'/' \
8792
-e 's/^(ENV PYTHON_PIP_VERSION) .*/\1 '"$pipVersion"'/' \
8893
-e 's/^(FROM python):.*/\1:'"$version"'/' \
89-
"$version"/{,*/}Dockerfile
94+
"$version"/{,*/,*/*/}Dockerfile
9095
)
9196
fi
9297
for variant in wheezy alpine slim; do

0 commit comments

Comments
 (0)