From e4f9a12d1dc34f35fe12ea15f59edb5d8c85e1d9 Mon Sep 17 00:00:00 2001 From: Stefan Scherer Date: Thu, 25 Aug 2016 16:32:08 +0200 Subject: [PATCH] Introduce Dockerfiles for windowsservercore Signed-off-by: Stefan Scherer --- 4.8/windows/windowsservercore/Dockerfile | 18 ++++++++++++++++++ .../windowsservercore/onbuild/Dockerfile | 10 ++++++++++ 6.10/windows/windowsservercore/Dockerfile | 18 ++++++++++++++++++ .../windowsservercore/onbuild/Dockerfile | 10 ++++++++++ 7.7/windows/windowsservercore/Dockerfile | 18 ++++++++++++++++++ .../windowsservercore/onbuild/Dockerfile | 10 ++++++++++ test-build.ps1 | 8 ++++++++ 7 files changed, 92 insertions(+) create mode 100644 4.8/windows/windowsservercore/Dockerfile create mode 100644 4.8/windows/windowsservercore/onbuild/Dockerfile create mode 100644 6.10/windows/windowsservercore/Dockerfile create mode 100644 6.10/windows/windowsservercore/onbuild/Dockerfile create mode 100644 7.7/windows/windowsservercore/Dockerfile create mode 100644 7.7/windows/windowsservercore/onbuild/Dockerfile create mode 100755 test-build.ps1 diff --git a/4.8/windows/windowsservercore/Dockerfile b/4.8/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..f63dee4270 --- /dev/null +++ b/4.8/windows/windowsservercore/Dockerfile @@ -0,0 +1,18 @@ +FROM microsoft/windowsservercore + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info +ENV NODE_VERSION 4.8.1 +ENV NODE_SHA256 edb47c31de7891ddb58d5e1024e31c91b49b4f2226cf6c3e0c41e715ee6111e4 + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $env:NODE_SHA256) {exit 1} ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' ; \ + New-Item $($env:APPDATA + '\npm') ; \ + $env:PATH = 'C:\nodejs;{0}\npm;{1}' -f $env:APPDATA, $env:PATH ; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) ; \ + Remove-Item -Path node.zip + +CMD [ "node.exe" ] diff --git a/4.8/windows/windowsservercore/onbuild/Dockerfile b/4.8/windows/windowsservercore/onbuild/Dockerfile new file mode 100644 index 0000000000..b98696660b --- /dev/null +++ b/4.8/windows/windowsservercore/onbuild/Dockerfile @@ -0,0 +1,10 @@ +FROM node:4.8.1-windowsservercore + +RUN mkdir \app +WORKDIR /app + +ONBUILD COPY package.json package.json +ONBUILD RUN npm install ; Remove-Item $($env:APPDATA + '\npm-cache') -Force -Recurse ; Remove-Item $($env:TEMP + '\npm-*') -Force -Recurse +ONBUILD COPY . . + +CMD [ "npm.cmd", "start" ] diff --git a/6.10/windows/windowsservercore/Dockerfile b/6.10/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..e232cad2b0 --- /dev/null +++ b/6.10/windows/windowsservercore/Dockerfile @@ -0,0 +1,18 @@ +FROM microsoft/windowsservercore + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info +ENV NODE_VERSION 6.10.1 +ENV NODE_SHA256 28923f51691bb34dc399af4ceb567da487d7f4806aec5e6f0cfab1e6c3f2dd1c + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $env:NODE_SHA256) {exit 1} ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' ; \ + New-Item $($env:APPDATA + '\npm') ; \ + $env:PATH = 'C:\nodejs;{0}\npm;{1}' -f $env:APPDATA, $env:PATH ; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) ; \ + Remove-Item -Path node.zip + +CMD [ "node.exe" ] diff --git a/6.10/windows/windowsservercore/onbuild/Dockerfile b/6.10/windows/windowsservercore/onbuild/Dockerfile new file mode 100644 index 0000000000..c55ffc3653 --- /dev/null +++ b/6.10/windows/windowsservercore/onbuild/Dockerfile @@ -0,0 +1,10 @@ +FROM node:6.10.1-windowsservercore + +RUN mkdir \app +WORKDIR /app + +ONBUILD COPY package.json package.json +ONBUILD RUN npm install ; Remove-Item $($env:APPDATA + '\npm-cache') -Force -Recurse ; Remove-Item $($env:TEMP + '\npm-*') -Force -Recurse +ONBUILD COPY . . + +CMD [ "npm.cmd", "start" ] diff --git a/7.7/windows/windowsservercore/Dockerfile b/7.7/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..96fd50167b --- /dev/null +++ b/7.7/windows/windowsservercore/Dockerfile @@ -0,0 +1,18 @@ +FROM microsoft/windowsservercore + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV NPM_CONFIG_LOGLEVEL info +ENV NODE_VERSION 7.7.4 +ENV NODE_SHA256 dd573367cda68db3594544b973be2367c0df8fc5345402672079e6be873931cd + +RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \ + if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $env:NODE_SHA256) {exit 1} ; \ + Expand-Archive node.zip -DestinationPath C:\ ; \ + Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs' ; \ + New-Item $($env:APPDATA + '\npm') ; \ + $env:PATH = 'C:\nodejs;{0}\npm;{1}' -f $env:APPDATA, $env:PATH ; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) ; \ + Remove-Item -Path node.zip + +CMD [ "node.exe" ] diff --git a/7.7/windows/windowsservercore/onbuild/Dockerfile b/7.7/windows/windowsservercore/onbuild/Dockerfile new file mode 100644 index 0000000000..7e80f3b033 --- /dev/null +++ b/7.7/windows/windowsservercore/onbuild/Dockerfile @@ -0,0 +1,10 @@ +FROM node:7.7.4-windowsservercore + +RUN mkdir \app +WORKDIR /app + +ONBUILD COPY package.json package.json +ONBUILD RUN npm install ; Remove-Item $($env:APPDATA + '\npm-cache') -Force -Recurse ; Remove-Item $($env:TEMP + '\npm-*') -Force -Recurse +ONBUILD COPY . . + +CMD [ "npm.cmd", "start" ] diff --git a/test-build.ps1 b/test-build.ps1 new file mode 100755 index 0000000000..4306e88527 --- /dev/null +++ b/test-build.ps1 @@ -0,0 +1,8 @@ +docker build -t node:4.7.0-windowsservercore 4.7/windows/windowsservercore +docker build -t node:4.7.0-windowsservercore-onbuild 4.7/windows/windowsservercore/onbuild + +docker build -t node:6.9.2-windowsservercore 6.9/windows/windowsservercore +docker build -t node:6.9.2-windowsservercore-onbuild 6.9/windows/windowsservercore/onbuild + +docker build -t node:7.2.1-windowsservercore 7.2/windows/windowsservercore +docker build -t node:7.2.1-windowsservercore-onbuild 7.2/windows/windowsservercore/onbuild