Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created June 24, 2020 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/1e45da15fb033155cb0023d85f2b787b to your computer and use it in GitHub Desktop.
Save bjoerntx/1e45da15fb033155cb0023d85f2b787b to your computer and use it in GitHub Desktop.
# https://hub.docker.com/_/microsoft-windows-servercore
# "ltsc2016" to get fonts installed
# Server Core 2019 is shipped without fonts
FROM mcr.microsoft.com/windows/servercore:ltsc2016
# Copy the application from folder "app" to "C:\app" on container machine
COPY app/ /app
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Download and install Visual C++ Redistributable Packages for Visual Studio 2013
RUN Invoke-WebRequest -OutFile vc_redist.x64.exe https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe; \
Start-Process "vc_redist.x64.exe" -ArgumentList "/passive" -wait -Passthru; \
del vc_redist.x64.exe
# Install ASP.NET Core Runtime
# Checksum and direct link from: https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.5-windows-hosting-bundle-installer
RUN Invoke-WebRequest -OutFile dotnet-hosting-3.1.0-win.exe https://download.visualstudio.microsoft.com/download/pr/fa3f472e-f47f-4ef5-8242-d3438dd59b42/9b2d9d4eecb33fe98060fd2a2cb01dcd/dotnet-hosting-3.1.0-win.exe; \
Start-Process "dotnet-hosting-3.1.0-win.exe" -ArgumentList "/passive" -wait -Passthru; \
Remove-Item -Force dotnet-hosting-3.1.0-win.exe
WORKDIR /app
EXPOSE 80
ENTRYPOINT ["dotnet", "myDotnetCoreApp.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment