The following samples and guidance demonstrate how to use .NET and Docker for development, testing and production. You can use the samples for learning about containers or as the basis of your own container images.
Kubernetes samples are provided in the kubernetes directory.
- Build a .NET container image
- Build an ASP.NET Core container image
- Build a single file app
- Build a native AOT app
- Building a globalization and time zone aware (or unaware) image
- Build for a platform
- Selecting .NET image tags
- Enable (or disable) globalization
- Build and test a multi-project solution
- Run test in a container
- Build in an SDK container
- Run applications in an SDK container
- Run ASP.NET Core Applications in development with container and HTTPS
- Discover licensing for Linux image contents
- Host ASP.NET Core Images with container and HTTPS
- Push container images to Azure Container Registry
- Push container images to Docker Hub
- Deploy ASP.NET Core Applications to Azure Container Instances
- .NET 8 Container Workshop
- Introduction to .NET and Docker
- Announcing built-in container support for the .NET SDK
- Staying safe in containers
- Improving multi-platform container support
- Container blog posts
The following commands will run a .NET console app in a container:
docker run --rm mcr.microsoft.com/dotnet/samples
The following command will run an ASP.NET Core console app in a container that you can access in your web browser at http://localhost:8000
.
docker run --rm -it -p 8000:8080 mcr.microsoft.com/dotnet/samples:aspnetapp
- dotnet: .NET
- dotnet/framework: .NET Framework, ASP.NET and WCF