-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathdotnet.Dockerfile
45 lines (34 loc) · 1.85 KB
/
dotnet.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
38
39
40
41
42
43
44
45
# escape=`
# Installer image
FROM mcr.microsoft.com/windows/servercore:ltsc2019 AS installer-env
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Retrieve .NET Core SDK
RUN $dotnet_sdk_version = '3.1.102'; `
Invoke-WebRequest -OutFile dotnet.zip https://builds.dotnet.microsoft.com/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-win-x64.zip; `
$dotnet_sha512 = '4fc6efdf696d51c3c0651ab30c662eead668d0936ed2290c72a5d6a155a105c0e954f267924b69e61cffec53076630293dd810221bfac488d5961c243657ceca'; `
if ((Get-FileHash dotnet.zip -Algorithm sha512).Hash -ne $dotnet_sha512) { `
Write-Host 'CHECKSUM VERIFICATION FAILED!'; `
exit 1; `
}; `
`
Expand-Archive dotnet.zip -DestinationPath dotnet; `
Remove-Item -Force dotnet.zip
ENV ASPNETCORE_URLS=http://+:80 `
DOTNET_RUNNING_IN_CONTAINER=true `
DOTNET_USE_POLLING_FILE_WATCHER=true `
NUGET_XMLDOC_MODE=skip `
PublishWithAspNetCoreTargetManifest=false `
HOST_VERSION=3.24.0
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
$BuildNumber = $Env:HOST_VERSION.split('.')[-1]; `
Invoke-WebRequest -OutFile host.zip https://github.com/Azure/azure-functions-host/archive/v$Env:HOST_VERSION.zip; `
Expand-Archive host.zip .; `
cd azure-functions-host-$Env:HOST_VERSION; `
/dotnet/dotnet publish /p:BuildNumber=$BuildNumber /p:CommitHash=$Env:HOST_VERSION src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -c Release --output C:\runtime
# Runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-nanoserver-1903
COPY --from=installer-env ["C:\\runtime", "C:\\runtime"]
COPY start_deprecated.sh /azure-functions-host/
ENV AzureWebJobsScriptRoot=C:\approot `
WEBSITE_HOSTNAME=localhost:80
CMD ["/azure-functions-host/start_deprecated.sh"]