Public | Automated Build

Last pushed: a month ago
Short Description
Official images for running compiled ASP.NET Core applications.
Full Description

ASP.NET Core Runtime Docker Image

This repository contains images for running published ASP.NET Core applications. These images contain the runtime only. Use microsoft/aspnetcore-build to build ASP.NET Core apps inside the container.

Latest images for 2.1 and newer are now available on microsoft/dotnet. See this link for more details about migrating to 2.1.

The .NET Core Docker samples show various ways to use .NET Core and Docker together. See Building Docker Images for .NET Core Applications to learn more.

Linux amd64 tags

Windows Server, version 1803 amd64 tags

Windows Server, version 1709 amd64 tags

Windows Server 2016 amd64 tags

What is ASP.NET Core?

ASP.NET Core is a new open-source and cross-platform framework for building modern cloud based internet connected applications, such as web apps, IoT apps and mobile backends. It consists of modular components with minimal overhead, so you retain flexibility while constructing your solutions. You can develop and run your ASP.NET Core apps cross-platform on Windows, Mac and Linux. ASP.NET Core is open source at GitHub.

This image contains:

  • .NET Core so that you can run your already compiled .NET Core applications.
  • A set of native images for all of the ASP.NET Core libraries. These images will be used at runtime to increase
    the cold-start performance of your application. A significant amount of the time taken to JIT compile on startup of
    your application is typically spent compiling ASP.NET Core libraries rather than your application code. Given that
    these libraries are not going to change for a given version we include native images so that the runtime can load them
    instead of running the JIT.

Related images

How to use this image

  1. Create a Dockerfile for your application, the following example assumes you have already compiled your application (which is the expected use case for this image)

    FROM microsoft/aspnetcore
    WORKDIR /app
    COPY . .
    ENTRYPOINT ["dotnet", "myapp.dll"]
  2. Build and run your app:

    $ docker build -t myapp .
    $ docker run -d -p 8000:80 myapp
  3. Browse to localhost:8000 to access your app.

A note on ports

This image sets the ASPNETCORE_URLS environment variable to http://+:80 which means that if you have not explicity
set a URL in your application, via app.UseUrl in your Program.cs for example, then your application will be listening
on port 80 inside the container.

Docker Pull Command
Source Repository