From 5e7fd924073a338016ba21bb5f79eba44dc68385 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.7/windows/windowsservercore/Dockerfile | 18 ++++++++++++++++++ .../windowsservercore/onbuild/Dockerfile | 10 ++++++++++ 6.9/windows/windowsservercore/Dockerfile | 18 ++++++++++++++++++ .../windowsservercore/onbuild/Dockerfile | 10 ++++++++++ 7.2/windows/windowsservercore/Dockerfile | 18 ++++++++++++++++++ .../windowsservercore/onbuild/Dockerfile | 10 ++++++++++ test-build.ps1 | 8 ++++++++ 7 files changed, 92 insertions(+) create mode 100644 4.7/windows/windowsservercore/Dockerfile create mode 100644 4.7/windows/windowsservercore/onbuild/Dockerfile create mode 100644 6.9/windows/windowsservercore/Dockerfile create mode 100644 6.9/windows/windowsservercore/onbuild/Dockerfile create mode 100644 7.2/windows/windowsservercore/Dockerfile create mode 100644 7.2/windows/windowsservercore/onbuild/Dockerfile create mode 100755 test-build.ps1 diff --git a/4.7/windows/windowsservercore/Dockerfile b/4.7/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..b52927d9a6 --- /dev/null +++ b/4.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 4.7.0 +ENV NODE_SHA256 8b257f217ad882deffc2cd37d3aed7b8bbe57da1c4eb0b3b54cb529dff8ce811 + +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.7/windows/windowsservercore/onbuild/Dockerfile b/4.7/windows/windowsservercore/onbuild/Dockerfile new file mode 100644 index 0000000000..16b09edf97 --- /dev/null +++ b/4.7/windows/windowsservercore/onbuild/Dockerfile @@ -0,0 +1,10 @@ +FROM node:4.7.0-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.9/windows/windowsservercore/Dockerfile b/6.9/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..80e7949afb --- /dev/null +++ b/6.9/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.9.2 +ENV NODE_SHA256 3525201f28c2298953c4e0b03fe4fb080bf295ec9a722af2abbaa4ad53d3b491 + +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.9/windows/windowsservercore/onbuild/Dockerfile b/6.9/windows/windowsservercore/onbuild/Dockerfile new file mode 100644 index 0000000000..bffe6f3b90 --- /dev/null +++ b/6.9/windows/windowsservercore/onbuild/Dockerfile @@ -0,0 +1,10 @@ +FROM node:6.9.2-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.2/windows/windowsservercore/Dockerfile b/7.2/windows/windowsservercore/Dockerfile new file mode 100644 index 0000000000..3aa28520f5 --- /dev/null +++ b/7.2/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.2.1 +ENV NODE_SHA256 960ce0e9da98650c0cb86f9550d558996b2e13cff4c376991e74a852babe76ac + +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.2/windows/windowsservercore/onbuild/Dockerfile b/7.2/windows/windowsservercore/onbuild/Dockerfile new file mode 100644 index 0000000000..915fb97de5 --- /dev/null +++ b/7.2/windows/windowsservercore/onbuild/Dockerfile @@ -0,0 +1,10 @@ +FROM node:7.2.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/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