Skip to content

Commit 34cf210

Browse files
Merge pull request #109 from StefanScherer/use-gpg-for-nodejs
Update Node 4.8.2, 6.10.2 + Use gpg signature check and multi-stage build
2 parents 488ac40 + 5496669 commit 34cf210

16 files changed

Lines changed: 239 additions & 66 deletions

File tree

node/4.8/Dockerfile

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,45 @@ FROM microsoft/windowsservercore
22

33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

5-
ENV NPM_CONFIG_LOGLEVEL info
6-
ENV NODE_VERSION 4.8.1
7-
ENV NODE_SHA256 edb47c31de7891ddb58d5e1024e31c91b49b4f2226cf6c3e0c41e715ee6111e4
5+
ENV GPG_VERSION 2.3.3
6+
7+
RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
8+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait
9+
10+
RUN @( \
11+
'9554F04D7259F04124DE6B476D5A82AC7E37093B', \
12+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
13+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
14+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
15+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
16+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
17+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
18+
'56730D5401028683275BD23C23EFEFE93C4CFFFE' \
19+
) | foreach { \
20+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
21+
}
22+
23+
ENV NODE_VERSION 4.8.2
24+
25+
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
26+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
827

928
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
10-
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $env:NODE_SHA256) {exit 1} ; \
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' } ; \
1131
Expand-Archive node.zip -DestinationPath C:\ ; \
12-
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' ; \
13-
New-Item $($env:APPDATA + '\npm') ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
FROM microsoft/windowsservercore
35+
36+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
37+
38+
ENV NPM_CONFIG_LOGLEVEL info
39+
40+
COPY --from=0 /nodejs /nodejs
41+
42+
RUN New-Item $($env:APPDATA + '\npm') ; \
1443
$env:PATH = 'C:\nodejs;{0}\npm;{1}' -f $env:APPDATA, $env:PATH ; \
15-
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) ; \
16-
Remove-Item -Path node.zip
44+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
1745

1846
CMD [ "node.exe" ]

node/4.8/README.md

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

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

55
## Building
66

77
```
88
docker build -t node .
9-
docker tag node:latest node:4.8.1
9+
docker tag node:latest node:4.8.2
1010
```
1111

1212
## Onbuild

node/4.8/nano/Dockerfile

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
1-
FROM microsoft/nanoserver
1+
FROM microsoft/windowsservercore
22

33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

5-
ENV NPM_CONFIG_LOGLEVEL info
6-
ENV NODE_VERSION 4.8.1
7-
ENV NODE_SHA256 edb47c31de7891ddb58d5e1024e31c91b49b4f2226cf6c3e0c41e715ee6111e4
5+
ENV GPG_VERSION 2.3.3
6+
7+
RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
8+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait
9+
10+
RUN @( \
11+
'9554F04D7259F04124DE6B476D5A82AC7E37093B', \
12+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
13+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
14+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
15+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
16+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
17+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
18+
'56730D5401028683275BD23C23EFEFE93C4CFFFE' \
19+
) | foreach { \
20+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
21+
}
22+
23+
ENV NODE_VERSION 4.8.2
24+
25+
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
26+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
827

928
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
10-
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $env:NODE_SHA256) {exit 1} ; \
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' } ; \
1131
Expand-Archive node.zip -DestinationPath C:\ ; \
12-
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' ; \
13-
New-Item $($env:APPDATA + '\npm') ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
FROM microsoft/nanoserver
35+
36+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
37+
38+
ENV NPM_CONFIG_LOGLEVEL info
39+
40+
COPY --from=0 /nodejs /nodejs
41+
42+
RUN New-Item $($env:APPDATA + '\npm') ; \
1443
$env:PATH = 'C:\nodejs;{0}\npm;{1}' -f $env:APPDATA, $env:PATH ; \
15-
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH ; \
16-
Remove-Item -Path node.zip
44+
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH
1745
1846
CMD [ "node.exe" ]

node/4.8/nano/onbuild/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:4.8.1-nanoserver
1+
FROM node:4.8.2-nanoserver
22

33
RUN mkdir \app
44
WORKDIR /app

node/4.8/onbuild/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:4.8.1-windowsservercore
1+
FROM node:4.8.2-windowsservercore
22

33
RUN mkdir \app
44
WORKDIR /app

node/6.10/Dockerfile

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,45 @@ FROM microsoft/windowsservercore
22

33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

5-
ENV NPM_CONFIG_LOGLEVEL info
6-
ENV NODE_VERSION 6.10.1
7-
ENV NODE_SHA256 28923f51691bb34dc399af4ceb567da487d7f4806aec5e6f0cfab1e6c3f2dd1c
5+
ENV GPG_VERSION 2.3.3
6+
7+
RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
8+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait
9+
10+
RUN @( \
11+
'9554F04D7259F04124DE6B476D5A82AC7E37093B', \
12+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
13+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
14+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
15+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
16+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
17+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
18+
'56730D5401028683275BD23C23EFEFE93C4CFFFE' \
19+
) | foreach { \
20+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
21+
}
22+
23+
ENV NODE_VERSION 6.10.2
24+
25+
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
26+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
827

928
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
10-
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $env:NODE_SHA256) {exit 1} ; \
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' } ; \
1131
Expand-Archive node.zip -DestinationPath C:\ ; \
12-
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' ; \
13-
New-Item $($env:APPDATA + '\npm') ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
FROM microsoft/windowsservercore
35+
36+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
37+
38+
ENV NPM_CONFIG_LOGLEVEL info
39+
40+
COPY --from=0 /nodejs /nodejs
41+
42+
RUN New-Item $($env:APPDATA + '\npm') ; \
1443
$env:PATH = 'C:\nodejs;{0}\npm;{1}' -f $env:APPDATA, $env:PATH ; \
15-
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) ; \
16-
Remove-Item -Path node.zip
44+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
1745

1846
CMD [ "node.exe" ]

node/6.10/README.md

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

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

55
## Building
66

77
```
88
docker build -t node .
9-
docker tag node:latest node:6.10.1
9+
docker tag node:latest node:6.10.2
1010
```
1111

1212
## Onbuild

node/6.10/nano/Dockerfile

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
1-
FROM microsoft/nanoserver
1+
FROM microsoft/windowsservercore
22

33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

5-
ENV NPM_CONFIG_LOGLEVEL info
6-
ENV NODE_VERSION 6.10.1
7-
ENV NODE_SHA256 28923f51691bb34dc399af4ceb567da487d7f4806aec5e6f0cfab1e6c3f2dd1c
5+
ENV GPG_VERSION 2.3.3
6+
7+
RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
8+
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait
9+
10+
RUN @( \
11+
'9554F04D7259F04124DE6B476D5A82AC7E37093B', \
12+
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
13+
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
14+
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
15+
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
16+
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
17+
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
18+
'56730D5401028683275BD23C23EFEFE93C4CFFFE' \
19+
) | foreach { \
20+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
21+
}
22+
23+
ENV NODE_VERSION 6.10.2
24+
25+
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
26+
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
827

928
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
10-
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $env:NODE_SHA256) {exit 1} ; \
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' } ; \
1131
Expand-Archive node.zip -DestinationPath C:\ ; \
12-
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' ; \
13-
New-Item $($env:APPDATA + '\npm') ; \
32+
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
33+
34+
FROM microsoft/nanoserver
35+
36+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
37+
38+
ENV NPM_CONFIG_LOGLEVEL info
39+
40+
COPY --from=0 /nodejs /nodejs
41+
42+
RUN New-Item $($env:APPDATA + '\npm') ; \
1443
$env:PATH = 'C:\nodejs;{0}\npm;{1}' -f $env:APPDATA, $env:PATH ; \
15-
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH ; \
16-
Remove-Item -Path node.zip
44+
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH
1745
1846
CMD [ "node.exe" ]

node/6.10/nano/onbuild/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:6.10.1-nanoserver
1+
FROM node:6.10.2-nanoserver
22

33
RUN mkdir \app
44
WORKDIR /app

node/6.10/onbuild/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:6.10.1-windowsservercore
1+
FROM node:6.10.2-windowsservercore
22

33
RUN mkdir \app
44
WORKDIR /app

0 commit comments

Comments
 (0)