Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows Server Core 2025 Dockerfiles #1335

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/windowsservercore/ltsc2025/helix/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2025

SHELL ["cmd", "/S", "/C"]
USER ContainerAdministrator

RUN curl -SL --output %TEMP%\python.zip https://www.nuget.org/api/v2/package/python/3.7.3 `
&& md C:\Python C:\PythonTemp `
&& tar -zxf %TEMP%\python.zip -C C:\PythonTemp `
&& xcopy /s c:\PythonTemp\tools C:\Python `
&& rd /s /q c:\PythonTemp `
&& del /q %TEMP%\python.zip `
&& setx /M PYTHONPATH "C:\Python\Lib;C:\Python\DLLs;"

RUN md c:\\helixtmp && pushd c:\\helixtmp &&`
C:\Python\python.exe -m pip install --upgrade pip==20.2 --no-warn-script-location && `
C:\Python\python.exe -m pip install virtualenv==16.6.0 --no-warn-script-location && `
C:\Python\python.exe -m pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && `
for %f in (.\helix_scripts-*-py3-none-any.whl) do (C:\Python\python.exe -m pip install %f --no-warn-script-location) && `
popd && rd /s /q c:\\helixtmp && `
powershell -Command `
New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\' -Name 'dotnet.exe' -Force -ErrorAction SilentlyContinue ; `
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\dotnet.exe' -Value 2 -Name DumpType -Force ; `
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\dotnet.exe' -Value 'C:\cores' -Name DumpFolder -Force ; `
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\dotnet.exe' -Value 2 -Name DumpCount -Force ; `
New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\' -Name 'corerun.exe' -Force -ErrorAction SilentlyContinue ; `
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\corerun.exe' -Value 2 -Name DumpType -Force ; `
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\corerun.exe' -Value 'C:\cores' -Name DumpFolder -Force ; `
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\corerun.exe' -Value 2 -Name DumpCount -Force && `
setx /M PATH "%PATH%;C:\Python;C:\python\scripts"

WORKDIR C:\\Work
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# escape=`

FROM mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2025-helix-amd64

# Install 7zip
ENV ZIP7_VERSION=2409

RUN curl -SL --output %TEMP%\7zip-x64.exe https://www.7-zip.org/a/7z%ZIP7_VERSION%-x64.exe `
&& mkdir C:\7z `
&& %TEMP%\7zip-x64.exe /S /D="C:\7z" `
&& setx PATH "%PATH%;C:\7z"

# Install arial font for chrome
COPY arial.ttf c:/windows/fonts

# Install git
ENV GIT_VERSION=2.34.1
ENV GIT_INSTALLER=MinGit-${GIT_VERSION}-64-bit.zip

RUN curl -SL --output %TEMP%\%GIT_INSTALLER% https://github.com/git-for-windows/git/releases/download/v%GIT_VERSION%.windows.1/%GIT_INSTALLER% `
&& mkdir C:\git `
&& tar -C C:\git -zxf %TEMP%\%GIT_INSTALLER% `
&& setx PATH "%PATH%;C:\git\cmd"

# fix certificates for python to be able to download emscripten files
RUN certutil -generateSSTFromWU roots.sst && certutil -addstore -f root roots.sst && del roots.sst

# Install Emscripten toolchain
ENV `
EMSCRIPTEN_VERSION=3.1.34 `
EMSCRIPTEN_PATH="C:\emscripten" `
EMSDK_PATH="C:\emscripten\emsdk"

RUN mkdir %EMSCRIPTEN_PATH% `
&& cd %EMSCRIPTEN_PATH% `
&& git clone https://github.com/emscripten-core/emsdk.git %EMSDK_PATH% `
&& cd %EMSDK_PATH% `
&& git checkout %EMSCRIPTEN_VERSION% `
&& .\emsdk install %EMSCRIPTEN_VERSION%-upstream `
&& .\emsdk activate %EMSCRIPTEN_VERSION%-upstream `
&& .\upstream\emscripten\embuilder.bat build MINIMAL

# Install latest 18.x Node JS
ENV NODE_RELEASE=18

RUN powershell -Command " `
$ErrorActionPreference = 'Stop'; `
$ProgressPreference = 'SilentlyContinue'; `
`
$json = Invoke-RestMethod -Uri 'https://nodejs.org/dist/index.json'; `
$nodeVersionUrl = \"https://nodejs.org/dist/latest-v$env:NODE_RELEASE.x/SHASUMS256.txt\"; `
$versionInfo = Invoke-WebRequest -Uri $nodeVersionUrl -UseBasicParsing; `
$versionInfo.Content -match \"node-v$env:NODE_RELEASE\.\d+\.\d+-x64\.msi\" | Out-Null; `
$latestVersion = $matches[0]; `
$nodeUrl = \"https://nodejs.org/dist/latest-v$env:NODE_RELEASE.x/$latestVersion\"; `
Write-Host \"Installing Node from $nodeUrl\"; `
Invoke-WebRequest -Uri $nodeUrl -OutFile $env:TEMP\nodejs.msi; `
Start-Process msiexec.exe -ArgumentList '/i', $env:TEMP\nodejs.msi, '/quiet', '/passive', '/qn', '/norestart' -NoNewWindow -Wait"

# install latest jsvu and v8 engine
RUN npm install jsvu -g `
&& npm exec -c "jsvu --os=win64 --engines=v8" `
&& setx PATH "%PATH%;%USERPROFILE%\.jsvu\bin"
RUN v8 -e "console.log(version());quit();"
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# escape=`

FROM mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2025-helix-amd64

# Install 7zip
ENV ZIP7_VERSION=2409

RUN curl -SL --output %TEMP%\7zip-x64.exe https://www.7-zip.org/a/7z%ZIP7_VERSION%-x64.exe `
&& mkdir C:\7z `
&& %TEMP%\7zip-x64.exe /S /D="C:\7z" `
&& setx PATH "%PATH%;C:\7z"

# Install arial font for chrome
COPY arial.ttf c:/windows/fonts

# Install git
ENV GIT_VERSION=2.34.1
ENV GIT_INSTALLER=MinGit-${GIT_VERSION}-64-bit.zip

RUN curl -SL --output %TEMP%\%GIT_INSTALLER% https://github.com/git-for-windows/git/releases/download/v%GIT_VERSION%.windows.1/%GIT_INSTALLER% `
&& mkdir C:\git `
&& tar -C C:\git -zxf %TEMP%\%GIT_INSTALLER% `
&& setx PATH "%PATH%;C:\git\cmd"

# Enable long paths
RUN reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f

# Install latest 18.x Node JS
ENV NODE_RELEASE=18

RUN powershell -Command " `
$ErrorActionPreference = 'Stop'; `
$ProgressPreference = 'SilentlyContinue'; `
`
$json = Invoke-RestMethod -Uri 'https://nodejs.org/dist/index.json'; `
$nodeVersionUrl = \"https://nodejs.org/dist/latest-v$env:NODE_RELEASE.x/SHASUMS256.txt\"; `
$versionInfo = Invoke-WebRequest -Uri $nodeVersionUrl -UseBasicParsing; `
$versionInfo.Content -match \"node-v$env:NODE_RELEASE\.\d+\.\d+-x64\.msi\" | Out-Null; `
$latestVersion = $matches[0]; `
$nodeUrl = \"https://nodejs.org/dist/latest-v$env:NODE_RELEASE.x/$latestVersion\"; `
Write-Host \"Installing Node from $nodeUrl\"; `
Invoke-WebRequest -Uri $nodeUrl -OutFile $env:TEMP\nodejs.msi; `
Start-Process msiexec.exe -ArgumentList '/i', $env:TEMP\nodejs.msi, '/quiet', '/passive', '/qn', '/norestart' -NoNewWindow -Wait"

# install latest jsvu and v8 engine
RUN npm install jsvu -g `
&& npm exec -c "jsvu --os=win64 --engines=v8" `
&& setx PATH "%PATH%;%USERPROFILE%\.jsvu\bin"
RUN v8 -e "console.log(version());quit();"

# install vc redistributable for llvm 19
ENV VC_REDIST_VERSION 17

RUN curl -SL --output %TEMP%\vc_redist.x64.exe https://aka.ms/vs/%VC_REDIST_VERSION%/release/vc_redist.x64.exe `
&& %TEMP%\vc_redist.x64.exe /install /passive /norestart /wait `
&& del /q %TEMP%\vc_redist.x64.exe
Binary file not shown.
36 changes: 36 additions & 0 deletions src/windowsservercore/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,42 @@
}
}
]
},
{
"platforms": [
{
"dockerfile": "src/windowsservercore/ltsc2025/helix/amd64",
"os": "windows",
"osVersion": "windowsservercore-ltsc2025",
"tags": {
"windowsservercore-ltsc2025-helix-amd64": {}
}
}
]
},
{
"platforms": [
{
"dockerfile": "src/windowsservercore/ltsc2025/helix/webassembly/amd64",
"os": "windows",
"osVersion": "windowsservercore-ltsc2025",
"tags": {
"windowsservercore-ltsc2025-helix-webassembly-amd64": {}
}
}
]
},
{
"platforms": [
{
"dockerfile": "src/windowsservercore/ltsc2025/helix/webassembly-net8/amd64",
"os": "windows",
"osVersion": "windowsservercore-ltsc2025",
"tags": {
"windowsservercore-ltsc2025-helix-webassembly-net8-amd64": {}
}
}
]
}
]
}
Expand Down