dotnet / dotnet/announcements

.NET Core 2.1 Docker Image Updates

Open
#71 0 comments 0 reactions 0 assignees View on GitHub
.NET Core 2.1 Docker
Dominant language
No language data
Stars
1.4k
Forks
53
PR merge metrics
No merged PRs in 30d

Description

# .NET Core 2.1 Docker Image Updates

We have consolidating the set of Docker Hub repositories that we use for .NET Core and ASP.NET Core. We will use [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) as the only repository that we publish to for .NET Core 2.1 and later releases.

We added a set of environment variables to .NET Core images to make it easier to host ASP.NET Core sites at any .NET Core image layer and to enable `dotnet watch` in SDK container images without additional configuration.

Alpine and ARM32 image variants have been added and are supported.

[.NET Core Docker Samples](https://github.com/dotnet/dotnet-docker/blob/master/samples/README.md) have been moved to the [dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) repo. The samples have been updated for .NET Core 2.1. New samples have been added, including [Hosting ASP.NET Core Images with Docker over HTTPS](https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/aspnetcore-docker-https.md).

## Discussion

Please share your thoughts on this change and see what others are saying at:

* [dotnet/dotnet-docker #560](https://github.com/dotnet/dotnet-docker/issues/560)

## Details

The following changes have been made as part of the .NET Core 2.1 release.

### Repo consolidation

.NET Core and ASP.NET Core images will be published to the [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) Docker Hub repo for .NET Core 2.1 and later releases. Co-location of images improves image discovery. The .NET Core runtime and SDK images are already co-located. We are adding the ASP.NET Core runtime images to the [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) repo as a third image type. We are [no longer producing the microsoft/aspnetcore-build image](https://github.com/aspnet/Announcements/issues/298) with .NET Core 2.1.

The following three tags are now available at the [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) repo:

* `2.1-sdk`
* `2.1-aspnetcore-runtime`
* `2.1-runtime`

### Environment variables enable new scenarios

We added a set of environment variables to .NET Core docker images, for .NET Core 2.1 and later. These environment variables enable more scenarios to work without additional configuration, such as [developing ASP.NET Core applications in a container](https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/aspnet-docker-dev-in-container.md).

New sdk image environment variables ([example](https://github.com/dotnet/dotnet-docker/blob/master/2.1/sdk/bionic/amd64/Dockerfile#L28-L32))
* `ASPNETCORE_URLS=http://+:80`
* `DOTNET_RUNNING_IN_CONTAINER=true`
* `DOTNET_USE_POLLING_FILE_WATCHER=true`

New Linux runtime-deps image environment variables ([example](https://github.com/dotnet/dotnet-docker/blob/master/2.1/runtime-deps/alpine3.7/amd64/Dockerfile#L19-L21))
* `ASPNETCORE_URLS=http://+:80`
* `DOTNET_RUNNING_IN_CONTAINER=true`

New Windows runtime image environment variables ([example](https://github.com/dotnet/dotnet-docker/blob/master/2.1/runtime/nanoserver-1709/amd64/Dockerfile#L33-L35))
* `ASPNETCORE_URLS=http://+:80`
* `DOTNET_RUNNING_IN_CONTAINER=true`

### New image variants

Alpine and ARM32 image variants have been added and are supported as part of the .NET Core 2.1 release.

For Alpine, you must [use specific tags to create Alpine-based images](https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/README.md#build-and-run-the-sample-for-alpine-with-docker), such as `2.1-runtime-alpine`.

For ARM32, you can use the regular multi-arch tags, like `2.1-runtime` and `2.1-sdk` if you are building on an ARM32 device. If you are building on another type of machine, you need to use ARM32-specific tags for the runtime images you create, such as `2.1-runtime-bionic-arm32v7` (for Ubuntu 18.04).

### Related repos

The following repos are related to this announcement:

* [microsoft/aspnetcore](https://hub.docker.com/r/microsoft/aspnetcore/)
* [microsoft/aspnetcore-build](https://hub.docker.com/r/microsoft/aspnetcore-build/)
* [microsoft/dotnet/](https://hub.docker.com/r/microsoft/dotnet/)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.