Skip to content

Commit d044e93

Browse files
committed
Introduce Dockerfiles for windowsservercore
Signed-off-by: Stefan Scherer <[email protected]>
1 parent 86b033c commit d044e93

File tree

6 files changed

+62
-1
lines changed

6 files changed

+62
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM microsoft/windowsservercore
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
4+
5+
ENV NPM_CONFIG_LOGLEVEL info
6+
ENV NODE_VERSION 4.6.0
7+
ENV NODE_SHA256 0782bd50251c2a159fba5b874c56fb4a6680f454cc16892cee8e62d17b7d6f60
8+
9+
RUN (New-Object System.Net.WebClient).DownloadFile('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION, 'node.zip') ; \
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" ]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:4.6.0
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" ]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM microsoft/windowsservercore
2+
3+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
4+
5+
ENV NPM_CONFIG_LOGLEVEL info
6+
ENV NODE_VERSION 6.7.0
7+
ENV NODE_SHA256 59971f8ea9fb1ac4c55ca36303fe32a0714049cf8a10843dbb5924a5d0624659
8+
9+
RUN (New-Object System.Net.WebClient).DownloadFile('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION, 'node.zip') ; \
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" ]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:6.7.0
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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
docker build -t node:4.6.0-windowsservercore 4.6/windows/windowsservercore
2+
docker build -t node:4.6.0-windowsservercore-onbuild 4.6/windows/windowsservercore/onbuild
3+
4+
docker build -t node:6.7.0-windowsservercore 6.7/windows/windowsservercore
5+
docker build -t node:6.7.0-windowsservercore-onbuild 6.7/windows/windowsservercore/onbuild

test-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fi
2525
versions=( "${versions[@]%/}" )
2626

2727
for version in "${versions[@]}"; do
28-
if [[ "$version" == "docs" ]]; then
28+
if [ "$version" == "docs" ] || [ "$version" == "windows" ]; then
2929
continue
3030
fi
3131

0 commit comments

Comments
 (0)