-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (27 loc) · 1.41 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
30
31
32
33
34
35
36
37
# escape=`
# Installer image
FROM mcr.microsoft.com/windows/servercore:1809 AS installer
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Install ASP.NET Core Runtime
ENV ASPNETCORE_VERSION 2.2.6
RUN Invoke-WebRequest -OutFile aspnetcore.zip https://dotnetcli.blob.core.windows.net/dotnet/aspnetcore/Runtime/$Env:ASPNETCORE_VERSION/aspnetcore-runtime-$Env:ASPNETCORE_VERSION-win-x64.zip; `
$aspnetcore_sha512 = '2fe420125b762fe5ce49e869c0a6f6e6318df024cbd6f37a743d2eae29136c8f982bd7b05e480639513520959e559ef45d6b590f95d83f5136e8931ff42506e5'; `
if ((Get-FileHash aspnetcore.zip -Algorithm sha512).Hash -ne $aspnetcore_sha512) { `
Write-Host 'CHECKSUM VERIFICATION FAILED!'; `
exit 1; `
}; `
`
Expand-Archive aspnetcore.zip -DestinationPath dotnet; `
Remove-Item -Force aspnetcore.zip
# Runtime image
FROM mcr.microsoft.com/windows/nanoserver:1809
# Note: Runtime image's SHELL is the CMD shell (different than the installer image).
COPY --from=installer ["/dotnet", "/Program Files/dotnet"]
# In order to set system PATH, ContainerAdministrator must be used
USER ContainerAdministrator
RUN setx /M PATH "%PATH%;C:\Program Files\dotnet"
USER ContainerUser
# Configure web servers to bind to port 80 when present
ENV ASPNETCORE_URLS=http://+:80 `
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true