-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (36 loc) · 1.54 KB
/
Dockerfile
File metadata and controls
43 lines (36 loc) · 1.54 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# escape=`
# Installer image
FROM mcr.microsoft.com/windows/servercore:ltsc2025-amd64 AS installer
# Retrieve .NET Runtime
RUN powershell -Command `
$ErrorActionPreference = 'Stop'; `
$ProgressPreference = 'SilentlyContinue'; `
`
$dotnet_version = '11.0.0-preview.4.26230.115'; `
$dotnet_file = 'dotnet-runtime-' + $dotnet_version + '-win-x64.zip'; `
$dotnet_sha512_file = $dotnet_file + '.sha512'; `
`
Invoke-WebRequest -OutFile $dotnet_file https://ci.dot.net/public/Runtime/$dotnet_version/$dotnet_file; `
Invoke-WebRequest -OutFile $dotnet_sha512_file https://ci.dot.net/public-checksums/Runtime/$dotnet_version/$dotnet_sha512_file; `
`
if ((Get-FileHash $dotnet_file -Algorithm sha512).Hash -ne (Get-Content $dotnet_sha512_file)) { `
Write-Host 'CHECKSUM VERIFICATION FAILED!'; `
exit 1; `
}; `
`
mkdir dotnet; `
tar --gzip --extract --no-same-owner --file $dotnet_file --directory dotnet; `
Remove-Item -Force `
$dotnet_file, `
$dotnet_sha512_file
# Runtime image
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=11.0.0-preview.4.26230.115
RUN setx /M PATH "%PATH%;C:\Program Files\dotnet"
COPY --from=installer ["/dotnet", "/Program Files/dotnet"]