Skip to content

Instantly share code, notes, and snippets.

@yizhang82
Last active April 13, 2018 00:35
Show Gist options
  • Save yizhang82/d55cff504ae807e8a79e04e56856817a to your computer and use it in GitHub Desktop.
Save yizhang82/d55cff504ae807e8a79e04e56856817a to your computer and use it in GitHub Desktop.
Asp.NET core runtime environment on Windows Server Core 1709 on .NET Core 2.0.6 runtime
# escape=`
# Installer image
FROM microsoft/windowsservercore:1709 AS installer-env
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Retrieve the runtime store
RUN @('2.0.0', '2.0.3', '2.0.5', '2.0.6') | % { `
$downloadUrl = \"https://dist.asp.net/runtimestore/${_}/win-x64/aspnetcore.runtimestore.zip\"; `
Write-Host \"Downloading and extracting $downloadUrl\"; `
Invoke-WebRequest $downloadUrl -OutFile cache.zip; `
Expand-Archive cache.zip -DestinationPath RuntimeStore; `
Remove-Item -Force cache.zip; `
}
# Runtime image
FROM yizhang82/dotnet:2.0.6
# Set up network
ENV ASPNETCORE_URLS http://+:80
ENV ASPNETCORE_PKG_VERSION 2.0.6
# Set up the runtime store
COPY --from=installer-env ["RuntimeStore", "C:\\Program Files\\dotnet"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment