Skip to content

Commit e4f9a12

Browse files
committed
Introduce Dockerfiles for windowsservercore
Signed-off-by: Stefan Scherer <[email protected]>
1 parent 8f6f83b commit e4f9a12

File tree

7 files changed

+92
-0
lines changed

7 files changed

+92
-0
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM microsoft/windowsservercore
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4+
5+
ENV NPM_CONFIG_LOGLEVEL info
6+
ENV NODE_VERSION 4.8.1
7+
ENV NODE_SHA256 edb47c31de7891ddb58d5e1024e31c91b49b4f2226cf6c3e0c41e715ee6111e4
8+
9+
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} ; \
11+
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') ; \
14+
$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
17+
18+
CMD [ "node.exe" ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:4.8.1-windowsservercore
2+
3+
RUN mkdir \app
4+
WORKDIR /app
5+
6+
ONBUILD COPY package.json package.json
7+
ONBUILD RUN npm install ; Remove-Item $($env:APPDATA + '\npm-cache') -Force -Recurse ; Remove-Item $($env:TEMP + '\npm-*') -Force -Recurse
8+
ONBUILD COPY . .
9+
10+
CMD [ "npm.cmd", "start" ]
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM microsoft/windowsservercore
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4+
5+
ENV NPM_CONFIG_LOGLEVEL info
6+
ENV NODE_VERSION 6.10.1
7+
ENV NODE_SHA256 28923f51691bb34dc399af4ceb567da487d7f4806aec5e6f0cfab1e6c3f2dd1c
8+
9+
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} ; \
11+
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') ; \
14+
$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
17+
18+
CMD [ "node.exe" ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:6.10.1-windowsservercore
2+
3+
RUN mkdir \app
4+
WORKDIR /app
5+
6+
ONBUILD COPY package.json package.json
7+
ONBUILD RUN npm install ; Remove-Item $($env:APPDATA + '\npm-cache') -Force -Recurse ; Remove-Item $($env:TEMP + '\npm-*') -Force -Recurse
8+
ONBUILD COPY . .
9+
10+
CMD [ "npm.cmd", "start" ]
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM microsoft/windowsservercore
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4+
5+
ENV NPM_CONFIG_LOGLEVEL info
6+
ENV NODE_VERSION 7.7.4
7+
ENV NODE_SHA256 dd573367cda68db3594544b973be2367c0df8fc5345402672079e6be873931cd
8+
9+
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} ; \
11+
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') ; \
14+
$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
17+
18+
CMD [ "node.exe" ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:7.7.4-windowsservercore
2+
3+
RUN mkdir \app
4+
WORKDIR /app
5+
6+
ONBUILD COPY package.json package.json
7+
ONBUILD RUN npm install ; Remove-Item $($env:APPDATA + '\npm-cache') -Force -Recurse ; Remove-Item $($env:TEMP + '\npm-*') -Force -Recurse
8+
ONBUILD COPY . .
9+
10+
CMD [ "npm.cmd", "start" ]

test-build.ps1

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
docker build -t node:4.7.0-windowsservercore 4.7/windows/windowsservercore
2+
docker build -t node:4.7.0-windowsservercore-onbuild 4.7/windows/windowsservercore/onbuild
3+
4+
docker build -t node:6.9.2-windowsservercore 6.9/windows/windowsservercore
5+
docker build -t node:6.9.2-windowsservercore-onbuild 6.9/windows/windowsservercore/onbuild
6+
7+
docker build -t node:7.2.1-windowsservercore 7.2/windows/windowsservercore
8+
docker build -t node:7.2.1-windowsservercore-onbuild 7.2/windows/windowsservercore/onbuild

0 commit comments

Comments
 (0)