forked from dotnet/dotnet-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
29 lines (25 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2025-amd64
ENV `
# Configure web servers to bind to port 8080 when present
ASPNETCORE_HTTP_PORTS=8080 `
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true `
# .NET Runtime version
DOTNET_VERSION=9.0.2
# Install .NET Runtime
RUN powershell -Command `
$ErrorActionPreference = 'Stop'; `
$ProgressPreference = 'SilentlyContinue'; `
`
Invoke-WebRequest -OutFile dotnet.zip https://builds.dotnet.microsoft.com/dotnet/Runtime/$Env:DOTNET_VERSION/dotnet-runtime-$Env:DOTNET_VERSION-win-x64.zip; `
$dotnet_sha512 = 'a8c9402fab7f9f9afefea433e2f35f894f8411ea9b7139321b4dd4cc1a39cce59c678158dc0178e376d5bdd11bbdd48c1c748b7d0fdf7cbea7a8c5f8b7afb987'; `
if ((Get-FileHash dotnet.zip -Algorithm sha512).Hash -ne $dotnet_sha512) { `
Write-Host 'CHECKSUM VERIFICATION FAILED!'; `
exit 1; `
}; `
`
mkdir $Env:ProgramFiles\dotnet; `
tar -oxzf dotnet.zip -C $Env:ProgramFiles\dotnet; `
Remove-Item -Force dotnet.zip
RUN setx /M PATH "%PATH%;C:\Program Files\dotnet"