Skip to content

Commit 8f243bb

Browse files
MichaelSimonsThraka
authored andcommitted
Update .NET Core doc in response to moving Docker images to MCR (#11511)
* Update .NET Core doc in response to moving Docker images to MCR * Revert select changes as they are being reworked separately. This reverts commit 4e0a40f. * Updates per code review feedback
1 parent fb3465b commit 8f243bb

File tree

10 files changed

+35
-34
lines changed

10 files changed

+35
-34
lines changed

docs/core/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Check out [.NET Core Tutorials](tutorials/index.md) to learn how to create a sim
1515

1616
## Download .NET Core 2.2
1717

18-
Download the [.NET Core 2.2 SDK](https://www.microsoft.com/net/download) to try .NET Core on your Windows, macOS, or Linux machine. Visit [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) if you prefer to use Docker containers.
18+
Download the [.NET Core 2.2 SDK](https://www.microsoft.com/net/download) to try .NET Core on your Windows, macOS, or Linux machine. Visit [dotnet/core](https://hub.docker.com/_/microsoft-dotnet-core/) if you prefer to use Docker containers.
1919

2020
All .NET Core versions are available at [.NET Core Downloads](https://www.microsoft.com/net/download/archives) if you're looking for another .NET Core version.
2121

docs/core/versions/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ Each version of .NET Core implements a version of .NET Standard. Implementing a
105105
- [.NET Core distribution packaging](../build/distribution-packaging.md)
106106
- [.NET Core Support Lifecycle Fact Sheet](https://www.microsoft.com/net/core/support)
107107
- [.NET Core 2+ Version Binding](https://github.com/dotnet/designs/issues/3)
108-
- [Docker images for .NET Core](https://hub.docker.com/r/microsoft/dotnet/)
108+
- [Docker images for .NET Core](https://hub.docker.com/_/microsoft-dotnet-core/)

docs/standard/containerized-lifecycle-architecture/design-develop-containerized-apps/docker-apps-inner-loop-workflow.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ In Figure 4-24, you can see how a docker-compose file is added by using the Dock
9999

100100
**Figure 4-24**. Docker files added using the **Add Docker files to Workspace command**
101101

102-
When you add a DockerFile, you specify what base Docker image you’ll be using (like using `FROM microsoft/aspnetcore`). You'll usually build your custom image on top of a base image that you get from any official repository at the [Docker Hub registry](https://hub.docker.com/) (like an [image for .NET Core](https://hub.docker.com/r/microsoft/dotnet/) or the one [for Node.js](https://hub.docker.com/_/node/)).
102+
When you add a DockerFile, you specify what base Docker image you’ll be using (like using `FROM mcr.microsoft.com/dotnet/core/aspnet`). You'll usually build your custom image on top of a base image that you get from any official repository at the [Docker Hub registry](https://hub.docker.com/) (like an [image for .NET Core](https://hub.docker.com/_/microsoft-dotnet-core/) or the one [for Node.js](https://hub.docker.com/_/node/)).
103103

104104
***Use an existing official Docker image***
105105

@@ -109,7 +109,7 @@ The following is a sample DockerFile for a .NET Core container:
109109

110110
```Dockerfile
111111
# Base Docker image to use
112-
FROM microsoft/dotnet:2.1-aspnetcore-runtime
112+
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1
113113

114114
# Set the Working Directory and files to be copied to the image
115115
ARG source
@@ -123,7 +123,7 @@ EXPOSE 80
123123
ENTRYPOINT ["dotnet", "MyCustomMicroservice.dll"]
124124
```
125125

126-
In this case, the image is based on version 2.1 of the official ASP.NET Core Docker image (multi-arch for Linux and Windows), as per the line `FROM microsoft/dotnet:2.1-aspnetcore-runtime`. (For more information about this topic, see the [ASP.NET Core Docker Image](https://hub.docker.com/r/microsoft/aspnetcore/) page and the [.NET Core Docker Image](https://hub.docker.com/r/microsoft/dotnet/) page).
126+
In this case, the image is based on version 2.1 of the official ASP.NET Core Docker image (multi-arch for Linux and Windows), as per the line `FROM mcr.microsoft.com/dotnet/core/aspnet:2.1`. (For more information about this topic, see the [ASP.NET Core Docker Image](https://hub.docker.com/_/microsoft-dotnet-core-aspnet/) page and the [.NET Core Docker Image](https://hub.docker.com/_/microsoft-dotnet-core/) page).
127127

128128
In the DockerFile, you can also instruct Docker to listen to the TCP port that you'll use at runtime (such as port 80).
129129

@@ -137,9 +137,9 @@ You can specify additional configuration settings in the Dockerfile, depending o
137137
138138
**Use multi-arch image repositories**
139139

140-
A single image name in a repo can contain platform variants, such as a Linux image and a Windows image. This feature allows vendors like Microsoft (base image creators) to create a single repo to cover multiple platforms (that is, Linux and Windows). For example, the [microsoft/aspnetcore](https://hub.docker.com/r/microsoft/aspnetcore/) repository available in the Docker Hub registry provides support for Linux and Windows Nano Server by using the same image name.
140+
A single image name in a repo can contain platform variants, such as a Linux image and a Windows image. This feature allows vendors like Microsoft (base image creators) to create a single repo to cover multiple platforms (that is, Linux and Windows). For example, the [dotnet/core/aspnet](https://hub.docker.com/_/microsoft-dotnet-core-aspnet/) repository available in the Docker Hub registry provides support for Linux and Windows Nano Server by using the same image name.
141141

142-
Pulling the [microsoft/aspnetcore](https://hub.docker.com/r/microsoft/aspnetcore/) image from a Windows host pulls the Windows variant, whereas pulling the same image name from a Linux host pulls the Linux variant.
142+
Pulling the [dotnet/core/aspnet](https://hub.docker.com/_/microsoft-dotnet-core-aspnet/) image from a Windows host pulls the Windows variant, whereas pulling the same image name from a Linux host pulls the Linux variant.
143143

144144
***Create your base image from scratch***
145145

docs/standard/containerized-lifecycle-architecture/docker-terminology.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This section lists terms and definitions you should be familiar with before gett
2727

2828
**Registry**: A service that provides access to repositories. The default registry for most public images is [Docker Hub](https://hub.docker.com/) (owned by Docker as an organization). A registry usually contains repositories from multiple teams. Companies often have private registries to store and manage images they've created. Azure Container Registry is another example.
2929

30-
**Multi-arch image**: For multi-architecture, is a feature that simplifies the selection of the appropriate image, according to the platform where Docker is running, for example, when a Dockerfile requests a base image **`FROM microsoft/dotnet:2.1-sdk`** from the registry it actually gets **`2.1-sdk-nanoserver-1709`**, **`2.1-sdk-nanoserver-1803`** or **`2.1-sdk-alpine`**, depending on the operating system and version where Docker is running.
30+
**Multi-arch image**: For multi-architecture, is a feature that simplifies the selection of the appropriate image, according to the platform where Docker is running, for example, when a Dockerfile requests a base image **`FROM mcr.microsoft.com/dotnet/core/sdk:2.1`** from the registry it actually gets **`2.1-nanoserver-1709`**, **`2.1-nanoserver-1803`**, **`2.1-nanoserver-1809`** or **`2.1-stretch`**, depending on the operating system and version where Docker is running.
3131

3232
**Docker Hub**: A public registry to upload images and work with them. Docker Hub provides Docker image hosting, public or private registries, build triggers and web hooks, and integration with GitHub and Bitbucket.
3333

docs/standard/microservices-architecture/container-docker-introduction/docker-terminology.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This section lists terms and definitions you should be familiar with before gett
2727

2828
**Registry**: A service that provides access to repositories. The default registry for most public images is [Docker Hub](https://hub.docker.com/) (owned by Docker as an organization). A registry usually contains repositories from multiple teams. Companies often have private registries to store and manage images they've created. Azure Container Registry is another example.
2929

30-
**Multi-arch image**: For multi-architecture, is a feature that simplifies the selection of the appropriate image, according to the platform where Docker is running, e.g. when a Dockerfile requests a base image **FROM microsoft/dotnet:2.2-sdk** from the registry it actually gets **2.2-sdk-nanoserver-1709**, **2.2-sdk-nanoserver-1803**, **2.2-sdk-nanoserver-1809** or **2.2-sdk-alpine**, depending on the operating system and version where Docker is running.
30+
**Multi-arch image**: For multi-architecture, is a feature that simplifies the selection of the appropriate image, according to the platform where Docker is running, e.g. when a Dockerfile requests a base image **FROM mcr.microsoft.com/dotnet/core/sdk:2.2** from the registry it actually gets **2.2-sdk-nanoserver-1709**, **2.2-sdk-nanoserver-1803**, **2.2-sdk-nanoserver-1809** or **2.2-sdk-stretch**, depending on the operating system and version where Docker is running.
3131

3232
**Docker Hub**: A public registry to upload images and work with them. Docker Hub provides Docker image hosting, public or private registries, build triggers and web hooks, and integration with GitHub and Bitbucket.
3333

docs/standard/microservices-architecture/docker-application-development-process/docker-app-development-workflow.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@ In a similar fashion, Visual Studio can also add a docker-compose.yml file for t
9191

9292
You usually build a custom image for your container on top of a base image you get from an official repository like the [Docker Hub](https://hub.docker.com/) registry. That is precisely what happens under the covers when you enable Docker support in Visual Studio. Your Dockerfile will use an existing `aspnetcore` image.
9393

94-
Earlier we explained which Docker images and repos you can use, depending on the framework and OS you have chosen. For instance, if you want to use ASP.NET Core (Linux or Windows), the image to use is `microsoft/dotnet:2.2-aspnetcore-runtime`. Therefore, you just need to specify what base Docker image you will use for your container. You do that by adding `FROM microsoft/dotnet:2.2-aspnetcore-runtime` to your Dockerfile. This will be automatically performed by Visual Studio, but if you were to update the version, you update this value.
94+
Earlier we explained which Docker images and repos you can use, depending on the framework and OS you have chosen. For instance, if you want to use ASP.NET Core (Linux or Windows), the image to use is `mcr.microsoft.com/dotnet/core/aspnet:2.2`. Therefore, you just need to specify what base Docker image you will use for your container. You do that by adding `FROM mcr.microsoft.com/dotnet/core/aspnet:2.2` to your Dockerfile. This will be automatically performed by Visual Studio, but if you were to update the version, you update this value.
9595

9696
Using an official .NET image repository from Docker Hub with a version number ensures that the same language features are available on all machines (including development, testing, and production).
9797

9898
The following example shows a sample Dockerfile for an ASP.NET Core container.
9999

100100
```Dockerfile
101-
FROM microsoft/dotnet:2.2-aspnetcore-runtime
101+
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
102102
ARG source
103103
WORKDIR /app
104104
EXPOSE 80
105105
COPY ${source:-obj/Docker/publish} .
106106
ENTRYPOINT ["dotnet", " MySingleContainerWebApp.dll "]
107107
```
108108

109-
In this case, the image is based on version 2.2 of the official ASP.NET Core Docker image (multi-arch for Linux and Windows). This is the setting `FROM microsoft/dotnet:2.2-aspnetcore-runtime`. (For more information about this base image, see the [.NET Core Docker Image](https://hub.docker.com/r/microsoft/dotnet/) page.) In the Dockerfile, you also need to instruct Docker to listen on the TCP port you will use at runtime (in this case, port 80, as configured with the EXPOSE setting).
109+
In this case, the image is based on version 2.2 of the official ASP.NET Core Docker image (multi-arch for Linux and Windows). This is the setting `FROM mcr.microsoft.com/dotnet/core/aspnet:2.2`. (For more information about this base image, see the [.NET Core Docker Image](https://hub.docker.com/_/microsoft-dotnet-core/) page.) In the Dockerfile, you also need to instruct Docker to listen on the TCP port you will use at runtime (in this case, port 80, as configured with the EXPOSE setting).
110110

111111
You can specify additional configuration settings in the Dockerfile, depending on the language and framework you're using. For instance, the ENTRYPOINT line with `["dotnet", "MySingleContainerWebApp.dll"]` tells Docker to run a .NET Core application. If you're using the SDK and the .NET Core CLI (dotnet CLI) to build and run the .NET application, this setting would be different. The bottom line is that the ENTRYPOINT line and other settings will be different depending on the language and platform you choose for your application.
112112

@@ -126,7 +126,7 @@ You can specify additional configuration settings in the Dockerfile, depending o
126126

127127
### Using multi-arch image repositories
128128

129-
A single repo can contain platform variants, such as a Linux image and a Windows image. This feature allows vendors like Microsoft (base image creators) to create a single repo to cover multiple platforms (that is Linux and Windows). For example, the [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) repository available in the Docker Hub registry provides support for Linux and Windows Nano Server by using the same repo name.
129+
A single repo can contain platform variants, such as a Linux image and a Windows image. This feature allows vendors like Microsoft (base image creators) to create a single repo to cover multiple platforms (that is Linux and Windows). For example, the [dotnet/core](https://hub.docker.com/_/microsoft-dotnet-core/) repository available in the Docker Hub registry provides support for Linux and Windows Nano Server by using the same repo name.
130130

131131
If you specify a tag, targeting a platform that is explicit like in the following cases:
132132

@@ -168,11 +168,11 @@ Probably the best way to understand multi-stage is going through a Dockerfile in
168168
The initial Dockerfile might look something like this:
169169

170170
```Dockerfile
171-
1 FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
171+
1 FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base
172172
2 WORKDIR /app
173173
3 EXPOSE 80
174174
4
175-
5 FROM microsoft/dotnet:2.2-sdk AS build
175+
5 FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
176176
6 WORKDIR /src
177177
7 COPY src/Services/Catalog/Catalog.API/Catalog.API.csproj …
178178
8 COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks …
@@ -260,11 +260,11 @@ For the final optimization, it just happens that line 20 is redundant, as line 2
260260
The resulting file is then:
261261

262262
```Dockerfile
263-
1 FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
263+
1 FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base
264264
2 WORKDIR /app
265265
3 EXPOSE 80
266266
4
267-
5 FROM microsoft/dotnet:2.2-sdk AS publish
267+
5 FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS publish
268268
6 WORKDIR /src
269269
7 COPY . .
270270
8 RUN dotnet restore /ignoreprojectextensions:.dcproj

docs/standard/microservices-architecture/multi-container-microservice-net-applications/multi-container-applications-docker-compose.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ Note that the values set in the runtime environment always override the values d
428428
If you are exploring Docker and .NET Core on sources on the Internet, you will find Dockerfiles that demonstrate the simplicity of building a Docker image by copying your source into a container. These examples suggest that by using a simple configuration, you can have a Docker image with the environment packaged with your application. The following example shows a simple Dockerfile in this vein.
429429
430430
```Dockerfile
431-
FROM microsoft/dotnet
431+
FROM mcr.microsoft.com/dotnet/core/sdk:2.2
432432
WORKDIR /app
433433
ENV ASPNETCORE_URLS http://+:80
434434
EXPOSE 80
@@ -441,19 +441,20 @@ A Dockerfile like this will work. However, you can substantially optimize your i
441441

442442
In the container and microservices model, you are constantly starting containers. The typical way of using containers does not restart a sleeping container, because the container is disposable. Orchestrators (like Kubernetes and Azure Service Fabric) simply create new instances of images. What this means is that you would need to optimize by precompiling the application when it is built so the instantiation process will be faster. When the container is started, it should be ready to run. You should not restore and compile at run time, using `dotnet restore` and `dotnet build` commands from the dotnet CLI that, as you see in many blog posts about .NET Core and Docker.
443443

444-
The .NET team has been doing important work to make .NET Core and ASP.NET Core a container-optimized framework. Not only is .NET Core a lightweight framework with a small memory footprint; the team has focused on optimized Docker images for three main scenarios and published them in the Docker Hub registry at *microsoft/dotnet*, beginning with version 2.1:
444+
The .NET team has been doing important work to make .NET Core and ASP.NET Core a container-optimized framework. Not only is .NET Core a lightweight framework with a small memory footprint; the team has focused on optimized Docker images for three main scenarios and published them in the Docker Hub registry at *dotnet/core*, beginning with version 2.1:
445445

446446
1. **Development**: Where the priority is the ability to quickly iterate and debug changes, and where size is secondary.
447447

448448
2. **Build**: The priority is compiling the application and includes binaries and other dependencies to optimize binaries.
449449

450450
3. **Production**: Where the focus is fast deploying and starting of containers, so these images are limited to the binaries and the content needed to run the application.
451451

452-
To achieve this, the .NET team is providing three basic variants in [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) (at Docker Hub):
452+
To achieve this, the .NET team is providing four basic variants in [dotnet/core](https://hub.docker.com/_/microsoft-dotnet-core/) (at Docker Hub):
453453

454-
1. **sdk**: for the development and build scenarios.
455-
2. **runtime**: for the production scenario and
456-
3. **runtime-deps**: for the production scenario of [self-contained applications](../../../core/deploying/index.md#self-contained-deployments-scd).
454+
1. **sdk**: for development and build scenarios
455+
1. **aspnet**: for ASP.NET production scenarios
456+
1. **runtime**: for .NET production scenarios
457+
1. **runtime-deps**: for production scenarios of [self-contained applications](../../../core/deploying/index.md#self-contained-deployments-scd).
457458

458459
For faster startup, runtime images also automatically set aspnetcore\_urls to port 80 and use Ngen to create a native image cache of assemblies.
459460

docs/standard/microservices-architecture/net-core-net-framework-containers/net-container-os-targets.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ When you add the image name to your Dockerfile file, you can select the operatin
3333
</thead>
3434
<tbody>
3535
<tr>
36-
<td>microsoft/dotnet:2.2-runtime</td>
36+
<td>mcr.microsoft.com/dotnet/core/runtime:2.2</td>
3737
<td>.NET Core 2.2 multi-architecture: Supports Linux and Windows Nano Server depending on the Docker host.</td>
3838
</tr>
3939
<tr class="odd">
40-
<td>microsoft/dotnet:2.2-aspnetcore-runtime</td>
40+
<td>mcr.microsoft.com/dotnet/core/aspnet:2.2</td>
4141
<td><p>ASP.NET Core 2.2 multi-architecture: Supports Linux and Windows Nano Server depending on the Docker host.</p>
4242
<p>The aspnetcore image has a few optimizations for ASP.NET Core.</p></td>
4343
</tr>
4444
<tr class="even">
45-
<td>microsoft/dotnet:2.2-aspnetcore-runtime-alpine</td>
45+
<td>mcr.microsoft.com/dotnet/core/aspnet:2.2-alpine</td>
4646
<td>.NET Core 2.2 runtime-only on Linux Alpine distro</td>
4747
</tr>
4848
<tr class="odd">
49-
<td>microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-1803</td>
49+
<td>mcr.microsoft.com/dotnet/core/aspnet:2.2-nanoserver-1803</td>
5050
<td>.NET Core 2.2 runtime-only on Windows Nano Server (Windows Server version 1803)</td>
5151
</tr>
5252
</tbody>

0 commit comments

Comments
 (0)