This repo contains samples that demonstrate various .NET Core Docker configurations, which you can use as the basis of your own Docker images. The samples can also be used with and without Docker.
You can pick the sample that best fits the scenario you are interested in, on Windows, macOS or Linux.
You can run a pre-built .NET Core sample using Docker. The source of this sample application is the dotnetapp-prod sample.
Type the following command to run the sample:
docker run microsoft/dotnet-samples
The following samples show different ways to use .NET Core images. They depend on the .NET Core 2.0 Docker images on Docker Hub, provided by the .NET Team at Microsoft. They use Docker multi-stage build and multi-arch tags where appropriate.
- .NET Core "Starter" Docker Sample - This sample builds and runs a single project in Docker. It's a simple sample to start with.
- .NET Core End-to-End Docker Sample - This sample builds, tests and runs the sample using Docker. It includes and builds multiple projects.
- ASP.NET Core Docker Sample - This samples demonstrates a Dockerized ASP.NET Core Web App.
- .NET Core self-contained application Docker Production Sample - This sample is also good for production scenarios since it relies on an operating system image (without .NET Core). Self-contained .NET Core apps include .NET Core as part of the app and not as a centrally installed component in a base image.
- .NET Core Docker Alpine Production Sample - This sample illustrates how to use the new lightweight Alpine based .NET Core Runtime image that is currently in preview.
Related: See .NET Core Alpine Docker Image announcement
- .NET Core Docker Production Sample - This sample includes instructions for running a runtime image with Linux on a Raspberry Pi.
- .NET Core self-contained application Docker Production Sample - This sample includes instructions for running a self-contained image with Linux on a Raspberry Pi.
- Related: See .NET Core on Raspberry Pi
See the following related Docker Hub repos:
- microsoft/aspnet for ASP.NET Web Forms and MVC images.
- microsoft/aspnetcore for ASP.NET Core images.
- microsoft/dotnet for .NET Core images.
- microsoft/dotnet-samples for .NET Core sample images.
- microsoft/dotnet-framework for .NET Framework images (for web applications, see microsoft/aspnet).
- microsoft/dotnet-framework-samples for .NET Framework sample images.
See the following related GitHub repos:
- dotnet/announcements for Docker-related announcements.
- microsoft/dotnet-framework-docker-samples for .NET Framework samples.