.NET Core Docker example

The following example demonstrates how to use the guidelines and .NET Core Docker and development, testing and production. You can sample as the basis for their Docker image, or just learn it.

 

Build the image

 

Construction of .NET Core Docker image (  https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/README.md )

Construction of ASP.NET Core Docker image ( https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/README.md )

Build and test multi-project solution (  https://github.com/dotnet/dotnet-docker/blob/master/samples/complexapp/README.md  )

 

 

Development Guidance

 

Docker build environment ( https://github.com/dotnet/dotnet-docker/blob/master/samples/establishing-docker-environment.md )

Select .NET Core image tag (  https://github.com/dotnet/dotnet-docker/blob/master/samples/selecting-tags.md )

Test runs in a container (  https://github.com/dotnet/dotnet-docker/blob/master/samples/run-tests-in-sdk-container.md )

Construction of the SDK vessel ( https://github.com/dotnet/dotnet-docker/blob/master/samples/build-in-sdk-container.md )

Run the application (in the SDK vessel  https://github.com/dotnet/dotnet-docker/blob/master/samples/run-in-sdk-container.md )

Use Docker and HTTPS run ASP.NET Core application (in development  https://github.com/dotnet/dotnet-docker/blob/master/samples/run-aspnetcore-https-development.md   )

 

 

Hosted guide

 

Docker and use HTTPS hosting ASP.NET Core Image ( https://github.com/dotnet/dotnet-docker/blob/master/samples/host-aspnetcore-https.md )

The image Docker push registry Azure container ( https://github.com/dotnet/dotnet-docker/blob/master/samples/push-image-to-acr.md )

The image Docker push the Hub Docker (  https://github.com/dotnet/dotnet-docker/blob/master/samples/push-image-to-dockerhub.md )

The ASP.NET Core deploy the application to the container instance Azure ( https://github.com/dotnet/dotnet-docker/blob/master/samples/deploy-container-to-aci.md )

 

 

Example fragment

In addition to the fully operational example project it is also provided snippet   ( https://github.com/dotnet/dotnet-docker/blob/master/samples/snippets   ) to demonstrate a more specific scenario.

 

NuGet management certificate (in Docker scene  https://github.com/dotnet/dotnet-docker/blob/master/samples/snippets/nuget-credentials.md   )

Installed .NET Core (in the Dockerfile https://github.com/dotnet/dotnet-docker/blob/master/samples/snippets/installing-dotnet.md )

Use System.Drawing.Common package (container in Docker  https://github.com/dotnet/dotnet-docker/blob/master/samples/snippets/using-system-drawing-common.md )

 

Try to pre-built image

 

The following command will run .NET Core console application in the container:

1 docker run --rm mcr.microsoft.com/dotnet/core/samples

 

The following command will run in a container ASP.NET Core Console application, you can access the container in a Web browser, the URL is http: // localhost: 8000

1 docker run --rm -it -p 8000:80 mcr.microsoft.com/dotnet/core/samples:aspnetapp

 

 

Docker repository

 

You can find a .NET container Docker image in the following repository:

dotnet/core:  .NET Core    ( https://hub.docker.com/_/microsoft-dotnet-core/ )

dotnet/framework: .NET Framework   (https://hub.docker.com/_/microsoft-dotnet-framework/)

 

Guess you like

Origin www.cnblogs.com/bisslot/p/12459436.html