diff --git a/10/windows/nanoserver/Dockerfile b/10/windows/nanoserver/Dockerfile new file mode 100644 index 0000000000..4301717f64 --- /dev/null +++ b/10/windows/nanoserver/Dockerfile @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 10.0.0 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 1.6.0 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/nanoserver + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH + +CMD [ "node.exe" ] diff --git a/10/windows/windowsservercore/Dockerfile b/10/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..7ab9a9e23f --- /dev/null +++ b/10/windows/windowsservercore/Dockerfile @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 10.0.0 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 1.6.0 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/windowsservercore + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) + +CMD [ "node.exe" ] diff --git a/6/windows/nanoserver/Dockerfile b/6/windows/nanoserver/Dockerfile new file mode 100644 index 0000000000..c0dadc42d7 --- /dev/null +++ b/6/windows/nanoserver/Dockerfile @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 6.14.2 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 1.6.0 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/nanoserver + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH + +CMD [ "node.exe" ] diff --git a/6/windows/windowsservercore/Dockerfile b/6/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..6e797d4c7d --- /dev/null +++ b/6/windows/windowsservercore/Dockerfile @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 6.14.2 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 1.6.0 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/windowsservercore + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) + +CMD [ "node.exe" ] diff --git a/8/windows/nanoserver/Dockerfile b/8/windows/nanoserver/Dockerfile new file mode 100644 index 0000000000..a9ae5a9f18 --- /dev/null +++ b/8/windows/nanoserver/Dockerfile @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 8.11.1 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 1.5.1 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/nanoserver + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH + +CMD [ "node.exe" ] diff --git a/8/windows/windowsservercore/Dockerfile b/8/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..374fffe1f1 --- /dev/null +++ b/8/windows/windowsservercore/Dockerfile @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 8.11.1 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 1.5.1 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/windowsservercore + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) + +CMD [ "node.exe" ] diff --git a/9/windows/nanoserver/Dockerfile b/9/windows/nanoserver/Dockerfile new file mode 100644 index 0000000000..13330e480c --- /dev/null +++ b/9/windows/nanoserver/Dockerfile @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 9.11.1 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 1.5.1 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/nanoserver + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH + +CMD [ "node.exe" ] diff --git a/9/windows/windowsservercore/Dockerfile b/9/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..349cea2cf3 --- /dev/null +++ b/9/windows/windowsservercore/Dockerfile @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 9.11.1 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 1.5.1 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/windowsservercore + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) + +CMD [ "node.exe" ] diff --git a/Dockerfile-nanoserver.template b/Dockerfile-nanoserver.template new file mode 100644 index 0000000000..bb6a37a419 --- /dev/null +++ b/Dockerfile-nanoserver.template @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 0.0.0 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 0.0.0 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/nanoserver + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH + +CMD [ "node.exe" ] diff --git a/Dockerfile-windowsservercore.template b/Dockerfile-windowsservercore.template new file mode 100644 index 0000000000..5ccaf03c58 --- /dev/null +++ b/Dockerfile-windowsservercore.template @@ -0,0 +1,57 @@ +FROM microsoft/windowsservercore as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV GPG_VERSION 2.3.4 + +RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \ + Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait + +RUN @( \ + '9554F04D7259F04124DE6B476D5A82AC7E37093B', \ + '94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \ + 'FD3A5288F042B6850C66B31F09FE44734EB7990E', \ + '71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \ + 'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \ + 'B9AE9905FFD7803F25714661B63B535A4C206CA9', \ + 'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \ + '56730D5401028683275BD23C23EFEFE93C4CFFFE' \ + ) | foreach { \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \ + } + +ENV NODE_VERSION 0.0.0 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \ + gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + $sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' + +ENV YARN_VERSION 0.0.0 + +RUN Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \ + $sig = Get-AuthenticodeSignature yarn.msi ; \ + if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \ + if (@( \ + '7E253367F8A102A91D04829E37F3410F14B68A5F' \ + ) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \ + Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait + +FROM microsoft/windowsservercore + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info + +COPY --from=download /nodejs /nodejs +COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ] + +RUN New-Item $($env:APPDATA + '\npm') -Type Directory ; \ + $env:PATH = 'C:\nodejs;{0}\npm;C:\yarn\bin;{1}' -f $env:APPDATA, $env:PATH ; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) + +CMD [ "node.exe" ] diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..0909999e70 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,9 @@ +version: 1.0.{build} +image: Visual Studio 2017 + +build_script: + - ps: Install-Package -Name docker -ProviderName DockerMsftProvider -RequiredVersion 17.06.1-ee-1-rc1 -Force + - ps: start-service docker + - docker pull microsoft/windowsservercore + - docker pull microsoft/nanoserver + - ps: .\test-build.ps1 diff --git a/architectures b/architectures index 4378f73d86..e60b843326 100644 --- a/architectures +++ b/architectures @@ -1,5 +1,6 @@ bashbrew-arch variants amd64 default,alpine,onbuild,slim,stretch,wheezy +window-amd64 windowsservercore,nanoserver ppc64le default,alpine,onbuild,slim,stretch s390x default,alpine,onbuild,slim,stretch arm64v8 default,alpine,onbuild,slim,stretch diff --git a/functions.sh b/functions.sh index 86eb306212..b14a2f9d6a 100755 --- a/functions.sh +++ b/functions.sh @@ -81,6 +81,42 @@ function get_variants() { fi } +# Get corresponding variants based on the architecture. +# All supported variants of each supported architecutre are listed in a +# file - 'architectures'. Its format is: +# ,... +# ,... +function get_windows_variants() { + local dir + dir=${1:-.} + shift + + local arch + local availablevariants + local variantsfilter + local variants + + arch="window-"$(get_arch) + variantsfilter=( "$@" ) + IFS=' ' read -ra availablevariants <<< "$(grep "^$arch" "$dir/architectures" | sed -E 's/'"$arch"'[[:space:]]*//' | sed -E 's/,/ /g')" + + if [ ${#variantsfilter[@]} -gt 0 ]; then + for variant1 in "${availablevariants[@]}"; do + for variant2 in "${variantsfilter[@]}"; do + if [[ "$variant1" = "$variant2" ]]; then + variants+=("$variant1") + fi + done + done + + if [ ${#variants[@]} -gt 0 ]; then + echo "${variants[@]}" + fi + else + echo "${availablevariants[@]}" + fi +} + # Get supported architectures for a specific version and variant # # Get default supported architectures from 'architectures'. Then go to the version folder diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index a5609fa120..96776e030b 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -92,4 +92,25 @@ for version in "${versions[@]}"; do echo "Directory: ${version}/${variant}" echo done + + variants=$(get_variants windows-amd64 | tr ' ' '\n') + for variant in $variants; do + # Skip non-docker directories + [ -f "$version/windows/$variant/Dockerfile" ] || continue + + commit="$(fileCommit "$version/windows/$variant")" + + slash='/' + variantAliases=( "${versionAliases[@]/%/-${variant//$slash/-}}" ) + variantAliases=( "${variantAliases[@]//latest-/}" ) + # Get supported architectures for a specific version and variant. + # See details in function.sh + supportedArches=( $(get_supported_arches "$version" "$variant") ) + + echo "Tags: $(join ', ' "${variantAliases[@]}")" + echo "Architectures: $(join ', ' "${supportedArches[@]}")" + echo "GitCommit: ${commit}" + echo "Directory: ${version}/windows/${variant}" + echo + done done diff --git a/test-build.ps1 b/test-build.ps1 new file mode 100755 index 0000000000..593d67bc76 --- /dev/null +++ b/test-build.ps1 @@ -0,0 +1,18 @@ +$ErrorActionPreference = 'Stop' + +ForEach ($Dir in dir -directory | where { $_.Name -ne "docs" }) { + $tag = ((cat $Dir\windows\windowsservercore\Dockerfile | Select-String -Pattern 'ENV NODE_VERSION') -split ' ')[2] + + $variants = @('windowsservercore', 'nanoserver') + ForEach ($variant in $variants) { + Write-Host Building node:$tag-$variant + docker build -t node:$tag-$variant $Dir/windows/$variant + + $OUTPUT=$(docker run --rm node:$tag-$variant node -e "process.stdout.write(process.versions.node)") + if ( "$OUTPUT" -Ne "$tag" ) { + Write-Error "Test of $tag-$variant failed!" + } else { + Write-Host "Test of $tag-$variant succeeded." + } + } +} diff --git a/update.sh b/update.sh index 53d5d3dafd..d30e77257b 100755 --- a/update.sh +++ b/update.sh @@ -55,7 +55,7 @@ function update_node_version { ) } -function add_stage { +function add_travis_stage { local baseuri=$1 shift local version=$1 @@ -83,7 +83,7 @@ for version in "${versions[@]}"; do versionnum=$(basename "$version") baseuri=$(get_config "$parentpath" "baseuri") - add_stage "$baseuri" "$version" "default" + add_travis_stage "$baseuri" "$version" "default" update_node_version "$baseuri" "$versionnum" "$parentpath/Dockerfile.template" "$version/Dockerfile" & # Get supported variants according the target architecture @@ -93,9 +93,14 @@ for version in "${versions[@]}"; do for variant in "${variants[@]}"; do # Skip non-docker directories [ -f "$version/$variant/Dockerfile" ] || continue - add_stage "$baseuri" "$version" "$variant" + add_travis_stage "$baseuri" "$version" "$variant" update_node_version "$baseuri" "$versionnum" "$parentpath/Dockerfile-$variant.template" "$version/$variant/Dockerfile" "$variant" & done + + IFS=' ' read -ra windows_variants <<< "$(get_windows_variants "$parentpath")" + for variant in "${windows_variants[@]}"; do + update_node_version "$baseuri" "$versionnum" "$parentpath/Dockerfile-$variant.template" "$version/windows/$variant/Dockerfile" "$variant" & + done done wait