Skip to content

Commit 84defe3

Browse files
authored
Merge pull request docker-library#224 from nwt/windows-server-1803
Add support for Windows Server 1803
2 parents a6d6468 + e652874 commit 84defe3

File tree

5 files changed

+224
-5
lines changed

5 files changed

+224
-5
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
FROM microsoft/windowsservercore:1803
2+
3+
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
5+
6+
# install MinGit (especially for "go get")
7+
# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/
8+
# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested."
9+
# "It currently requires only ~45MB on disk."
10+
ENV GIT_VERSION 2.11.1
11+
ENV GIT_TAG v${GIT_VERSION}.windows.1
12+
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip
13+
ENV GIT_DOWNLOAD_SHA256 668d16a799dd721ed126cc91bed49eb2c072ba1b25b50048280a4e2c5ed56e59
14+
# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install)
15+
RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
16+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
17+
Invoke-WebRequest -Uri $env:GIT_DOWNLOAD_URL -OutFile 'git.zip'; \
18+
\
19+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \
20+
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \
21+
Write-Host 'FAILED!'; \
22+
exit 1; \
23+
}; \
24+
\
25+
Write-Host 'Expanding ...'; \
26+
Expand-Archive -Path git.zip -DestinationPath C:\git\.; \
27+
\
28+
Write-Host 'Removing ...'; \
29+
Remove-Item git.zip -Force; \
30+
\
31+
Write-Host 'Updating PATH ...'; \
32+
$env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
33+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
34+
\
35+
Write-Host 'Verifying install ...'; \
36+
Write-Host ' git --version'; git --version; \
37+
\
38+
Write-Host 'Complete.';
39+
40+
# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
41+
ENV GOPATH C:\\gopath
42+
43+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
44+
RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
45+
Write-Host ('Updating PATH: {0}' -f $newPath); \
46+
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine);
47+
# doing this first to share cache across versions more aggressively
48+
49+
ENV GOLANG_VERSION 1.10.3
50+
51+
RUN $url = ('https://golang.org/dl/go{0}.windows-amd64.zip' -f $env:GOLANG_VERSION); \
52+
Write-Host ('Downloading {0} ...' -f $url); \
53+
Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \
54+
\
55+
$sha256 = 'a3f19d4fc0f4b45836b349503e347e64e31ab830dedac2fc9c390836d4418edb'; \
56+
Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \
57+
if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \
58+
Write-Host 'FAILED!'; \
59+
exit 1; \
60+
}; \
61+
\
62+
Write-Host 'Expanding ...'; \
63+
Expand-Archive go.zip -DestinationPath C:\; \
64+
\
65+
Write-Host 'Verifying install ("go version") ...'; \
66+
go version; \
67+
\
68+
Write-Host 'Removing ...'; \
69+
Remove-Item go.zip -Force; \
70+
\
71+
Write-Host 'Complete.';
72+
73+
WORKDIR $GOPATH
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
FROM microsoft/windowsservercore:1803
2+
3+
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
5+
6+
# install MinGit (especially for "go get")
7+
# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/
8+
# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested."
9+
# "It currently requires only ~45MB on disk."
10+
ENV GIT_VERSION 2.11.1
11+
ENV GIT_TAG v${GIT_VERSION}.windows.1
12+
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip
13+
ENV GIT_DOWNLOAD_SHA256 668d16a799dd721ed126cc91bed49eb2c072ba1b25b50048280a4e2c5ed56e59
14+
# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install)
15+
RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
16+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
17+
Invoke-WebRequest -Uri $env:GIT_DOWNLOAD_URL -OutFile 'git.zip'; \
18+
\
19+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \
20+
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \
21+
Write-Host 'FAILED!'; \
22+
exit 1; \
23+
}; \
24+
\
25+
Write-Host 'Expanding ...'; \
26+
Expand-Archive -Path git.zip -DestinationPath C:\git\.; \
27+
\
28+
Write-Host 'Removing ...'; \
29+
Remove-Item git.zip -Force; \
30+
\
31+
Write-Host 'Updating PATH ...'; \
32+
$env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
33+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
34+
\
35+
Write-Host 'Verifying install ...'; \
36+
Write-Host ' git --version'; git --version; \
37+
\
38+
Write-Host 'Complete.';
39+
40+
# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
41+
ENV GOPATH C:\\gopath
42+
43+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
44+
RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
45+
Write-Host ('Updating PATH: {0}' -f $newPath); \
46+
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine);
47+
# doing this first to share cache across versions more aggressively
48+
49+
ENV GOLANG_VERSION 1.11beta1
50+
51+
RUN $url = ('https://golang.org/dl/go{0}.windows-amd64.zip' -f $env:GOLANG_VERSION); \
52+
Write-Host ('Downloading {0} ...' -f $url); \
53+
Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \
54+
\
55+
$sha256 = '1eeb874a919143f3e62b641ccd5ebbfd1b3d4f2184de1d6497f7b2b6df996960'; \
56+
Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \
57+
if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \
58+
Write-Host 'FAILED!'; \
59+
exit 1; \
60+
}; \
61+
\
62+
Write-Host 'Expanding ...'; \
63+
Expand-Archive go.zip -DestinationPath C:\; \
64+
\
65+
Write-Host 'Verifying install ("go version") ...'; \
66+
go version; \
67+
\
68+
Write-Host 'Removing ...'; \
69+
Remove-Item go.zip -Force; \
70+
\
71+
Write-Host 'Complete.';
72+
73+
WORKDIR $GOPATH
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
FROM microsoft/windowsservercore:1803
2+
3+
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
5+
6+
# install MinGit (especially for "go get")
7+
# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/
8+
# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested."
9+
# "It currently requires only ~45MB on disk."
10+
ENV GIT_VERSION 2.11.1
11+
ENV GIT_TAG v${GIT_VERSION}.windows.1
12+
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip
13+
ENV GIT_DOWNLOAD_SHA256 668d16a799dd721ed126cc91bed49eb2c072ba1b25b50048280a4e2c5ed56e59
14+
# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install)
15+
RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
16+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
17+
Invoke-WebRequest -Uri $env:GIT_DOWNLOAD_URL -OutFile 'git.zip'; \
18+
\
19+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \
20+
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \
21+
Write-Host 'FAILED!'; \
22+
exit 1; \
23+
}; \
24+
\
25+
Write-Host 'Expanding ...'; \
26+
Expand-Archive -Path git.zip -DestinationPath C:\git\.; \
27+
\
28+
Write-Host 'Removing ...'; \
29+
Remove-Item git.zip -Force; \
30+
\
31+
Write-Host 'Updating PATH ...'; \
32+
$env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
33+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
34+
\
35+
Write-Host 'Verifying install ...'; \
36+
Write-Host ' git --version'; git --version; \
37+
\
38+
Write-Host 'Complete.';
39+
40+
# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
41+
ENV GOPATH C:\\gopath
42+
43+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
44+
RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
45+
Write-Host ('Updating PATH: {0}' -f $newPath); \
46+
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine);
47+
# doing this first to share cache across versions more aggressively
48+
49+
ENV GOLANG_VERSION 1.9.7
50+
51+
RUN $url = ('https://golang.org/dl/go{0}.windows-amd64.zip' -f $env:GOLANG_VERSION); \
52+
Write-Host ('Downloading {0} ...' -f $url); \
53+
Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \
54+
\
55+
$sha256 = '8db4b21916a3bc79f48d0611202ee5814c82f671b36d5d2efcb446879456cd28'; \
56+
Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \
57+
if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \
58+
Write-Host 'FAILED!'; \
59+
exit 1; \
60+
}; \
61+
\
62+
Write-Host 'Expanding ...'; \
63+
Expand-Archive go.zip -DestinationPath C:\; \
64+
\
65+
Write-Host 'Verifying install ("go version") ...'; \
66+
go version; \
67+
\
68+
Write-Host 'Removing ...'; \
69+
Remove-Item go.zip -Force; \
70+
\
71+
Write-Host 'Complete.';
72+
73+
WORKDIR $GOPATH

generate-stackbrew-library.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ for version in "${versions[@]}"; do
7373

7474
for v in \
7575
stretch alpine3.{7,6} \
76-
windows/windowsservercore-{ltsc2016,1709} \
77-
windows/nanoserver-{sac2016,1709} \
76+
windows/nanoserver-{sac2016,1709,1803} \
77+
windows/windowsservercore-{ltsc2016,1709,1803} \
7878
; do
7979
dir="$version/$v"
8080

update.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ for version in "${versions[@]}"; do
125125
done
126126

127127
for winVariant in \
128-
nanoserver-{1709,sac2016} \
129-
windowsservercore-{1709,ltsc2016} \
128+
nanoserver-{sac2016,1709,1803} \
129+
windowsservercore-{ltsc2016,1709,1803} \
130130
; do
131131
if [ -d "$version/windows/$winVariant" ]; then
132132
sed -r \
@@ -136,7 +136,7 @@ for version in "${versions[@]}"; do
136136
"Dockerfile-windows-${winVariant%%-*}.template" > "$version/windows/$winVariant/Dockerfile"
137137

138138
case "$winVariant" in
139-
*-1709) ;; # no AppVeyor support for 1709 yet: https://github.com/appveyor/ci/issues/1885
139+
*-1709|*-1803) ;; # no AppVeyor support for 1709 or 1803 yet: https://github.com/appveyor/ci/issues/1885
140140
*) appveyorEnv='\n - version: '"$version"'\n variant: '"$winVariant$appveyorEnv" ;;
141141
esac
142142
fi

0 commit comments

Comments
 (0)