O'Reilly logo
live online training icon Live Online training

Building .NET 5 Applications Using Docker

Exploring .NET 5, .NET Core 3.1, and Docker

Sidney Andrews

This live online training will help any .NET developer who wants to get started building their applications in containers. While the demos in this training will highlight .NET 5, they can be performed as-is on earlier versions of .NET Core and can even be recreated in .NET Framework with more significant modifications.

This session will focus on teaching the fundamental concepts necessary to perform .NET build and publish steps within the context of a Docker container. At the end of this session, a container image with a .NET application will be published to Docker Hub and be made ready to be hosted anywhere, including the cloud.

What you'll learn-and how you can apply it

  • Review the basic functions of the .NET CLI
  • Understand the basic functions of the Docker CLI
  • Build .NET applications in a running Docker container
  • Build .NET applications using a Dockerfile
  • Build multi-stage Dockerfiles using customized .NET publish settings
  • Host a .NET Dockerfile in Docker Hub

This training course is for you because...

  • You are someone in your organization that builds or manages .NET applications
  • Your organization is evaluating Docker for hosting and running your .NET solutions
  • You would like to streamline your CI/CD processing using Docker


  • Ability to create .NET applications
  • Ability to use the command line terminal in your OS

Course Set-up - Install Docker (more details provided here) - Install Visual Studio Code - Install .NET 5 - Install .NET SDK

Recommended Preparation - (live online training) Getting Started with .NET 5 by Sidney Andrews (dates vary; search the O'Reilly Learning Platform for an upcoming class)

Recommended Follow-up - (video) Docker for ASP.NET Core MVC by Chris Small: https://learning.oreilly.com/videos/docker-for-asp-net/9781788831468

About your instructor

  • Sidney Andrews is an Azure MVP and a Microsoft Certified Training Regional Lead located in Richmond, VA. Sidney has authored multiple official developer and Azure courses including 70-532, 70-535, AZ-200, AZ-201, and AZ-203. Sidney has been featured as a presenter on Channel 9, Ignite and Build. His specialties include Azure, NoSQL, XAML, C# and TypeScript.


The timeframes are only estimates and may vary according to how the class is progressing

Day 1

Segment 1: .NET CLI Review Length: 15 mins

  • Checking version
  • Restore, Build, and Run commands
  • Publish commands

Segment 2: Docker CLI Basics Length: 15

  • Pull/Push container images
  • Run a container
  • Connect to running containers

Segment 3: .NET Container Images Length: 20 mins

  • <mcr.microsoft.com> registry
  • Tags and versioning
  • Pulling .NET images

Break: 10 mins

Segment 4: Container-based Builds Length: 0:20

  • Build application within a container
  • Move assets between container and host

Segment 5: Authoring Dockerfiles Length: 30 mins

  • .NET base images
  • Working directories
  • Copy files to Dockerfile
  • Running commands
  • Setting entry point

Break: 10 mins

Segment 6: Multi-stage Builds Length: 20 mins

  • Splitting builds between SDK and runtime images
  • Copy files between stages

Segment 7: Standalone Builds Length: 20 mins

  • Building .NET for environments without .NET installed
  • Modifications for .NET in “vanilla” Linux distros

Segment 8: Pushing to Docker Hub Length: 15 mins

  • Getting credentials from Docker Hub
  • Pushing to Docker Hub
  • Versioning using tags