Skip to content

Commit 598d844

Browse files
StefanSchererLaurentGoderre
authored andcommitted
Introduce Windows Docker images
1 parent 0d9c13c commit 598d844

File tree

17 files changed

+685
-3
lines changed

17 files changed

+685
-3
lines changed

10/windows/nanoserver/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM microsoft/windowsservercore as download
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4+
5+
ENV NODE_VERSION 10.0.0
6+
7+
ENV GPG_VERSION 2.3.4
8+
9+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
10+
Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
11+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait ;
12+
13+
RUN @( \
14+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
15+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
16+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
17+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
18+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
19+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
20+
'56730D5401028683275BD23C23EFEFE93C4CFFFE', \
21+
'77984A986EBC2AA786BC0F66B01FBB92821C587A' \
22+
) | foreach { \
23+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
24+
} ; \
25+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
26+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
27+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc ; \
28+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
29+
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
30+
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
31+
Expand-Archive node.zip -DestinationPath C:\ ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
ENV YARN_VERSION 1.6.0
35+
36+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
37+
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \
38+
$sig = Get-AuthenticodeSignature -filepath yarn.msi ; \
39+
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \
40+
if (@( \
41+
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' \
42+
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \
43+
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
44+
45+
FROM microsoft/nanoserver
46+
47+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
48+
49+
ENV NODE_VERSION 10.0.0
50+
51+
COPY --from=download /nodejs /nodejs
52+
COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ]
53+
54+
RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \
55+
$env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \
56+
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH
57+
58+
CMD [ "node.exe" ]
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM microsoft/windowsservercore as download
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4+
5+
ENV NODE_VERSION 10.0.0
6+
7+
ENV GPG_VERSION 2.3.4
8+
9+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
10+
Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
11+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait ;
12+
13+
RUN @( \
14+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
15+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
16+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
17+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
18+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
19+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
20+
'56730D5401028683275BD23C23EFEFE93C4CFFFE', \
21+
'77984A986EBC2AA786BC0F66B01FBB92821C587A' \
22+
) | foreach { \
23+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
24+
} ; \
25+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
26+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
27+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc ; \
28+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
29+
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
30+
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
31+
Expand-Archive node.zip -DestinationPath C:\ ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
ENV YARN_VERSION 1.6.0
35+
36+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
37+
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \
38+
$sig = Get-AuthenticodeSignature -filepath yarn.msi ; \
39+
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \
40+
if (@( \
41+
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' \
42+
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \
43+
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
44+
45+
FROM microsoft/windowsservercore
46+
47+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
48+
49+
ENV NODE_VERSION 10.0.0
50+
51+
COPY --from=download /nodejs /nodejs
52+
COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ]
53+
54+
RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \
55+
$env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \
56+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
57+
58+
CMD [ "node.exe" ]

6/windows/nanoserver/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM microsoft/windowsservercore as download
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4+
5+
ENV NODE_VERSION 6.14.2
6+
7+
ENV GPG_VERSION 2.3.4
8+
9+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
10+
Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
11+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait ;
12+
13+
RUN @( \
14+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
15+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
16+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
17+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
18+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
19+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
20+
'56730D5401028683275BD23C23EFEFE93C4CFFFE', \
21+
'77984A986EBC2AA786BC0F66B01FBB92821C587A' \
22+
) | foreach { \
23+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
24+
} ; \
25+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
26+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
27+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc ; \
28+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
29+
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
30+
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
31+
Expand-Archive node.zip -DestinationPath C:\ ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
ENV YARN_VERSION 1.6.0
35+
36+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
37+
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \
38+
$sig = Get-AuthenticodeSignature -filepath yarn.msi ; \
39+
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \
40+
if (@( \
41+
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' \
42+
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \
43+
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
44+
45+
FROM microsoft/nanoserver
46+
47+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
48+
49+
ENV NODE_VERSION 6.14.2
50+
51+
COPY --from=download /nodejs /nodejs
52+
COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ]
53+
54+
RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \
55+
$env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \
56+
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH
57+
58+
CMD [ "node.exe" ]
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM microsoft/windowsservercore as download
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4+
5+
ENV NODE_VERSION 6.14.2
6+
7+
ENV GPG_VERSION 2.3.4
8+
9+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
10+
Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
11+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait ;
12+
13+
RUN @( \
14+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
15+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
16+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
17+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
18+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
19+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
20+
'56730D5401028683275BD23C23EFEFE93C4CFFFE', \
21+
'77984A986EBC2AA786BC0F66B01FBB92821C587A' \
22+
) | foreach { \
23+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
24+
} ; \
25+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
26+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
27+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc ; \
28+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
29+
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
30+
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
31+
Expand-Archive node.zip -DestinationPath C:\ ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
ENV YARN_VERSION 1.6.0
35+
36+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
37+
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \
38+
$sig = Get-AuthenticodeSignature -filepath yarn.msi ; \
39+
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \
40+
if (@( \
41+
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' \
42+
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \
43+
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
44+
45+
FROM microsoft/windowsservercore
46+
47+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
48+
49+
ENV NODE_VERSION 6.14.2
50+
51+
COPY --from=download /nodejs /nodejs
52+
COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ]
53+
54+
RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \
55+
$env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \
56+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
57+
58+
CMD [ "node.exe" ]

8/windows/nanoserver/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM microsoft/windowsservercore as download
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4+
5+
ENV NODE_VERSION 8.11.1
6+
7+
ENV GPG_VERSION 2.3.4
8+
9+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
10+
Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
11+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait ;
12+
13+
RUN @( \
14+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
15+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
16+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
17+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
18+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
19+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
20+
'56730D5401028683275BD23C23EFEFE93C4CFFFE', \
21+
'77984A986EBC2AA786BC0F66B01FBB92821C587A' \
22+
) | foreach { \
23+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
24+
} ; \
25+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
26+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
27+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc ; \
28+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
29+
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
30+
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
31+
Expand-Archive node.zip -DestinationPath C:\ ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
ENV YARN_VERSION 1.6.0
35+
36+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
37+
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \
38+
$sig = Get-AuthenticodeSignature -filepath yarn.msi ; \
39+
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \
40+
if (@( \
41+
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' \
42+
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \
43+
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
44+
45+
FROM microsoft/nanoserver
46+
47+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
48+
49+
ENV NODE_VERSION 8.11.1
50+
51+
COPY --from=download /nodejs /nodejs
52+
COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ]
53+
54+
RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \
55+
$env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \
56+
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH
57+
58+
CMD [ "node.exe" ]
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM microsoft/windowsservercore as download
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4+
5+
ENV NODE_VERSION 8.11.1
6+
7+
ENV GPG_VERSION 2.3.4
8+
9+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
10+
Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
11+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait ;
12+
13+
RUN @( \
14+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
15+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
16+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
17+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
18+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
19+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
20+
'56730D5401028683275BD23C23EFEFE93C4CFFFE', \
21+
'77984A986EBC2AA786BC0F66B01FBB92821C587A' \
22+
) | foreach { \
23+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
24+
} ; \
25+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
26+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
27+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc ; \
28+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
29+
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
30+
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
31+
Expand-Archive node.zip -DestinationPath C:\ ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
ENV YARN_VERSION 1.6.0
35+
36+
RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 ; \
37+
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \
38+
$sig = Get-AuthenticodeSignature -filepath yarn.msi ; \
39+
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \
40+
if (@( \
41+
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' \
42+
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \
43+
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
44+
45+
FROM microsoft/windowsservercore
46+
47+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
48+
49+
ENV NODE_VERSION 8.11.1
50+
51+
COPY --from=download /nodejs /nodejs
52+
COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ]
53+
54+
RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \
55+
$env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \
56+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
57+
58+
CMD [ "node.exe" ]

0 commit comments

Comments
 (0)