Skip to content

Commit 71a7b4a

Browse files
Update Node.js 10.19.0 (#436)
1 parent 25448db commit 71a7b4a

13 files changed

Lines changed: 273 additions & 21 deletions

File tree

node/10/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN @( \
2525
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
2626
}
2727

28-
ENV NODE_VERSION 10.16.3
28+
ENV NODE_VERSION 10.19.0
2929

3030
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
3131
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
@@ -36,7 +36,7 @@ RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f
3636
Expand-Archive node.zip -DestinationPath C:\ ; \
3737
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
3838

39-
ENV YARN_VERSION 1.13.0
39+
ENV YARN_VERSION 1.21.1
4040

4141
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
4242
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \

node/10/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# Node
22

3-
A Windows Server Core Docker container image with Node.js 10.16.3 installed.
3+
A Windows Server Core Docker container image with Node.js 10.19.0 installed.
44

55
## Images
66

7-
- stefanscherer/node-windows:10.16.3 -> Nano Server + Node + NPM + Yarn + Git
8-
- stefanscherer/node-windows:10.16.3-pure -> Nano Server + Node
9-
- stefanscherer/node-windows:10.16.3-windowsservercore -> Windows Server Core + Node + NPM + Yarn + Git
10-
- stefanscherer/node-windows:10.16.3-build-tools -> + Python + C++ build tools
7+
- stefanscherer/node-windows:10.19.0 -> Nano Server + Node + NPM + Yarn + Git
8+
- stefanscherer/node-windows:10.19.0-pure -> Nano Server + Node
9+
- stefanscherer/node-windows:10.19.0-windowsservercore -> Windows Server Core + Node + NPM + Yarn + Git
10+
- stefanscherer/node-windows:10.19.0-build-tools -> + Python + C++ build tools
1111

1212
## Building
1313

1414
To build the images yourself use the following commands:
1515

1616
```
17-
docker build -t node:10.16.3-windowsservercore .
18-
docker build -t node:10.16.3-nanoserver nano
19-
docker build -t node:10.16.3-pure pure
17+
docker build -t node:10.19.0-windowsservercore .
18+
docker build -t node:10.19.0-nanoserver nano
19+
docker build -t node:10.19.0-pure pure
2020
```
2121

2222
### Build with 1803 or newer base images
@@ -26,14 +26,14 @@ On Windows Server 1803 or any current Windows 10 machine you might want to use t
2626
The `Dockerfile` is prepared to run on any Windows platform, but you have to specify some build arguments to make it work with newer base images.
2727

2828
```
29-
docker build -t node:10.16.3-windowsservercore `
29+
docker build -t node:10.19.0-windowsservercore `
3030
--build-arg core=mcr.microsoft.com/windows/servercore:1803 `
3131
--build-arg target=mcr.microsoft.com/windows/nanoserver:1803 .
32-
docker build -t node:10.16.3-nanoserver `
32+
docker build -t node:10.19.0-nanoserver `
3333
--build-arg core=mcr.microsoft.com/windows/servercore:1803 `
3434
--build-arg target=mcr.microsoft.com/windows/nanoserver:1803 `
3535
--build-arg "SETX= " nano
36-
docker build -t node:10.16.3-pure `
36+
docker build -t node:10.19.0-pure `
3737
--build-arg core=mcr.microsoft.com/windows/servercore:1803 `
3838
--build-arg target=mcr.microsoft.com/windows/nanoserver:1803 pure
3939
```

node/10/build-tools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG node=node:10.16.3-windowsservercore
1+
ARG node=node:10.19.0-windowsservercore
22
FROM $node
33

44
RUN npm install --global --production --add-python-to-path windows-build-tools --vs2015

node/10/nano/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN @( \
2525
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
2626
}
2727

28-
ENV NODE_VERSION 10.16.3
28+
ENV NODE_VERSION 10.19.0
2929

3030
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
3131
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
@@ -36,7 +36,7 @@ RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f
3636
Expand-Archive node.zip -DestinationPath C:\ ; \
3737
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
3838

39-
ENV YARN_VERSION 1.13.0
39+
ENV YARN_VERSION 1.21.1
4040

4141
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
4242
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \

node/10/pure/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN @( \
2525
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
2626
}
2727

28-
ENV NODE_VERSION 10.16.3
28+
ENV NODE_VERSION 10.19.0
2929

3030
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
3131
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
@@ -36,7 +36,7 @@ RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f
3636
Expand-Archive node.zip -DestinationPath C:\ ; \
3737
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
3838

39-
ENV YARN_VERSION 1.13.0
39+
ENV YARN_VERSION 1.21.1
4040

4141
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
4242
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \

node/12/Dockerfile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
ARG core=mcr.microsoft.com/windows/servercore:ltsc2019
2+
ARG target=mcr.microsoft.com/windows/servercore:ltsc2019
3+
FROM $core as download
4+
5+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
6+
7+
ENV GPG_VERSION 2.3.4
8+
9+
RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
10+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait
11+
12+
RUN @( \
13+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
14+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
15+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
16+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
17+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
18+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
19+
'77984A986EBC2AA786BC0F66B01FBB92821C587A', \
20+
'8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600', \
21+
'4ED778F539E3634C779C87C6D7062848A1AB005C', \
22+
'A48C2BEE680E841632CD4E44F07496B3EB3C1762', \
23+
'B9E2F5981AA6E0CD28160D9FF13993A75599653C' \
24+
) | foreach { \
25+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
26+
}
27+
28+
ENV NODE_VERSION 12.16.1
29+
30+
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
31+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
32+
33+
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
34+
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
35+
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
36+
Expand-Archive node.zip -DestinationPath C:\ ; \
37+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
38+
39+
ENV YARN_VERSION 1.13.0
40+
41+
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
42+
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \
43+
$sig = Get-AuthenticodeSignature yarn.msi ; \
44+
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \
45+
Write-Output $sig.SignerCertificate.Thumbprint ; \
46+
if (@( \
47+
'7E253367F8A102A91D04829E37F3410F14B68A5F', \
48+
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' \
49+
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \
50+
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
51+
52+
ENV GIT_VERSION 2.20.1
53+
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/MinGit-${GIT_VERSION}-busybox-64-bit.zip
54+
ENV GIT_SHA256 9817ab455d9cbd0b09d8664b4afbe4bbf78d18b556b3541d09238501a749486c
55+
56+
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
57+
Invoke-WebRequest -UseBasicParsing $env:GIT_DOWNLOAD_URL -OutFile git.zip; \
58+
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_SHA256) {exit 1} ; \
59+
Expand-Archive git.zip -DestinationPath C:\git; \
60+
Remove-Item git.zip
61+
62+
FROM $target
63+
64+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
65+
66+
ENV NPM_CONFIG_LOGLEVEL info
67+
68+
COPY --from=download /nodejs /nodejs
69+
COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ]
70+
COPY --from=download /git /git
71+
72+
RUN $env:PATH = 'C:\nodejs;C:\yarn\bin;C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;{0}' -f $env:PATH ; \
73+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
74+
75+
CMD [ "node.exe" ]

node/12/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Node
2+
3+
A Windows Server Core Docker container image with Node.js 12.16.1 installed.
4+
5+
## Images
6+
7+
- stefanscherer/node-windows:12.16.1 -> Nano Server + Node + NPM + Yarn + Git
8+
- stefanscherer/node-windows:12.16.1-pure -> Nano Server + Node
9+
- stefanscherer/node-windows:12.16.1-windowsservercore -> Windows Server Core + Node + NPM + Yarn + Git
10+
- stefanscherer/node-windows:12.16.1-build-tools -> + Python + C++ build tools
11+
12+
## Building
13+
14+
To build the images yourself use the following commands:
15+
16+
```
17+
docker build -t node:12.16.1-windowsservercore .
18+
docker build -t node:12.16.1-nanoserver nano
19+
docker build -t node:12.16.1-pure pure
20+
```
21+
22+
### Build with 1803 or newer base images
23+
24+
On Windows Server 1803 or any current Windows 10 machine you might want to use the smaller base images.
25+
26+
The `Dockerfile` is prepared to run on any Windows platform, but you have to specify some build arguments to make it work with newer base images.
27+
28+
```
29+
docker build -t node:12.16.1-windowsservercore `
30+
--build-arg core=mcr.microsoft.com/windows/servercore:1803 `
31+
--build-arg target=mcr.microsoft.com/windows/nanoserver:1803 .
32+
docker build -t node:12.16.1-nanoserver `
33+
--build-arg core=mcr.microsoft.com/windows/servercore:1803 `
34+
--build-arg target=mcr.microsoft.com/windows/nanoserver:1803 `
35+
--build-arg "SETX= " nano
36+
docker build -t node:12.16.1-pure `
37+
--build-arg core=mcr.microsoft.com/windows/servercore:1803 `
38+
--build-arg target=mcr.microsoft.com/windows/nanoserver:1803 pure
39+
```
40+
41+
Watch out for the SETX parameter to have a blank value to overwrite the `/M` default needed for 2016.
42+

node/12/build-tools/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ARG node=node:12.16.1-windowsservercore
2+
FROM $node
3+
4+
RUN npm install --global --production --add-python-to-path windows-build-tools --vs2015

node/12/nano/Dockerfile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
ARG core=mcr.microsoft.com/windows/servercore:ltsc2019
2+
ARG target=mcr.microsoft.com/windows/nanoserver:1809
3+
FROM $core as download
4+
5+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
6+
7+
ENV GPG_VERSION 2.3.4
8+
9+
RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
10+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait
11+
12+
RUN @( \
13+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
14+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
15+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
16+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
17+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
18+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
19+
'77984A986EBC2AA786BC0F66B01FBB92821C587A', \
20+
'8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600', \
21+
'4ED778F539E3634C779C87C6D7062848A1AB005C', \
22+
'A48C2BEE680E841632CD4E44F07496B3EB3C1762', \
23+
'B9E2F5981AA6E0CD28160D9FF13993A75599653C' \
24+
) | foreach { \
25+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
26+
}
27+
28+
ENV NODE_VERSION 12.16.1
29+
30+
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
31+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
32+
33+
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
34+
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
35+
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
36+
Expand-Archive node.zip -DestinationPath C:\ ; \
37+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
38+
39+
ENV YARN_VERSION 1.13.0
40+
41+
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
42+
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \
43+
$sig = Get-AuthenticodeSignature yarn.msi ; \
44+
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \
45+
Write-Output $sig.SignerCertificate.Thumbprint ; \
46+
if (@( \
47+
'7E253367F8A102A91D04829E37F3410F14B68A5F', \
48+
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' \
49+
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \
50+
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
51+
52+
ENV GIT_VERSION 2.20.1
53+
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/MinGit-${GIT_VERSION}-busybox-64-bit.zip
54+
ENV GIT_SHA256 9817ab455d9cbd0b09d8664b4afbe4bbf78d18b556b3541d09238501a749486c
55+
56+
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
57+
Invoke-WebRequest -UseBasicParsing $env:GIT_DOWNLOAD_URL -OutFile git.zip; \
58+
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_SHA256) {exit 1} ; \
59+
Expand-Archive git.zip -DestinationPath C:\git; \
60+
Remove-Item git.zip
61+
62+
FROM $target
63+
64+
ENV NPM_CONFIG_LOGLEVEL info
65+
66+
COPY --from=download /nodejs /nodejs
67+
COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ]
68+
COPY --from=download /git /git
69+
70+
ARG SETX=/M
71+
USER ContainerAdministrator
72+
RUN setx %SETX% PATH "%PATH%;C:\nodejs;C:\yarn\bin;C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin"
73+
USER ContainerUser
74+
75+
CMD [ "node.exe" ]

node/12/pure/Dockerfile

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

0 commit comments

Comments
 (0)