This document discusses how Docker can help .NET developers by allowing them to containerize their .NET applications. It provides benefits like running applications across Windows and Linux containers, improving development workflows through features of Docker for Windows like Linux containers on Windows, and facilitating continuous integration and deployment of containerized applications through automation. The document provides examples of Dockerfiles for different types of .NET applications and demonstrates how to add Docker support and containerize existing applications using Visual Studio tools.
3. • Run .NET Framework applications in Windows containers
• Limited changes
• Encapsulate configuration and dependencies
• Refactor the monolith at your own pace
• Create new dotnetcore / aspnetcore applications
• Target Linux or Windows containers
• Familiar development experience / debugging
.NET Developer Benefits
12. Docker for Windows
provides a Linux VM for
local execution of
Docker containers.
Can verify mode.
Can swap between
modes from the task
tray.
Linux / Windows
13. Docker for Windows
provides a Linux VM for
local execution of
Docker containers.
Can verify mode.
Can swap between
modes from the task
tray.
Linux / Windows
15. Development Considerations
• Target environments and base image
• Debugging
• Access to logs
• Service dependencies and networking
• Environment variables
• CICD workflows
20. Add Docker to existing
dotnetcore or .NET
Framework projects.
Creates Dockerfile and
Docker project with
compose files ready for
debugging.
Add Docker
26. # Enable DNS resolution to work properly for all windows containers
# instead of caching (temporary fix)
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN set-itemproperty -path
'HKLM:SYSTEMCurrentControlSetServicesDnscacheParameters' -Name
ServerPriorityTimeLimit -Value 0 -Type Dword
# see music store sample
# https://github.com/docker/labs/blob/master/windows/windows-
containers/MultiContainerApp.md
DNS Resolution Reference
27. FROM microsoft/aspnet
ARG source
WORKDIR /inetpub/wwwroot
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["powershell", "./bootstrap.ps1"]
Environment Variables and IIS