You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: docs/core/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Check out [.NET Core Tutorials](tutorials/index.md) to learn how to create a sim
15
15
16
16
## Download .NET Core 2.2
17
17
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.
19
19
20
20
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.
Copy file name to clipboardExpand all lines: docs/standard/containerized-lifecycle-architecture/design-develop-containerized-apps/docker-apps-inner-loop-workflow.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ In Figure 4-24, you can see how a docker-compose file is added by using the Dock
99
99
100
100
**Figure 4-24**. Docker files added using the **Add Docker files to Workspace command**
101
101
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/)).
103
103
104
104
***Use an existing official Docker image***
105
105
@@ -109,7 +109,7 @@ The following is a sample DockerFile for a .NET Core container:
109
109
110
110
```Dockerfile
111
111
# Base Docker image to use
112
-
FROM microsoft/dotnet:2.1-aspnetcore-runtime
112
+
FROMmcr.microsoft.com/dotnet/core/aspnet:2.1
113
113
114
114
# Set the Working Directory and files to be copied to the image
115
115
ARG source
@@ -123,7 +123,7 @@ EXPOSE 80
123
123
ENTRYPOINT ["dotnet", "MyCustomMicroservice.dll"]
124
124
```
125
125
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).
127
127
128
128
In the DockerFile, you can also instruct Docker to listen to the TCP port that you'll use at runtime (such as port 80).
129
129
@@ -137,9 +137,9 @@ You can specify additional configuration settings in the Dockerfile, depending o
137
137
138
138
**Use multi-arch image repositories**
139
139
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.
141
141
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.
Copy file name to clipboardExpand all lines: docs/standard/containerized-lifecycle-architecture/docker-terminology.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ This section lists terms and definitions you should be familiar with before gett
27
27
28
28
**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.
29
29
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.
31
31
32
32
**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.
Copy file name to clipboardExpand all lines: docs/standard/microservices-architecture/container-docker-introduction/docker-terminology.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ This section lists terms and definitions you should be familiar with before gett
27
27
28
28
**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.
29
29
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.
31
31
32
32
**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.
Copy file name to clipboardExpand all lines: docs/standard/microservices-architecture/docker-application-development-process/docker-app-development-workflow.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,22 +91,22 @@ In a similar fashion, Visual Studio can also add a docker-compose.yml file for t
91
91
92
92
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.
93
93
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.
95
95
96
96
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).
97
97
98
98
The following example shows a sample Dockerfile for an ASP.NET Core container.
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).
110
110
111
111
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.
112
112
@@ -126,7 +126,7 @@ You can specify additional configuration settings in the Dockerfile, depending o
126
126
127
127
### Using multi-arch image repositories
128
128
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.
130
130
131
131
If you specify a tag, targeting a platform that is explicit like in the following cases:
132
132
@@ -168,11 +168,11 @@ Probably the best way to understand multi-stage is going through a Dockerfile in
168
168
The initial Dockerfile might look something like this:
169
169
170
170
```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
172
172
2 WORKDIR /app
173
173
3 EXPOSE 80
174
174
4
175
-
5 FROM microsoft/dotnet:2.2-sdk AS build
175
+
5 FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
Copy file name to clipboardExpand all lines: docs/standard/microservices-architecture/multi-container-microservice-net-applications/multi-container-applications-docker-compose.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -428,7 +428,7 @@ Note that the values set in the runtime environment always override the values d
428
428
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.
429
429
430
430
```Dockerfile
431
-
FROM microsoft/dotnet
431
+
FROM mcr.microsoft.com/dotnet/core/sdk:2.2
432
432
WORKDIR /app
433
433
ENV ASPNETCORE_URLS http://+:80
434
434
EXPOSE 80
@@ -441,19 +441,20 @@ A Dockerfile like this will work. However, you can substantially optimize your i
441
441
442
442
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.
443
443
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:
445
445
446
446
1.**Development**: Where the priority is the ability to quickly iterate and debug changes, and where size is secondary.
447
447
448
448
2.**Build**: The priority is compiling the application and includes binaries and other dependencies to optimize binaries.
449
449
450
450
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.
451
451
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):
453
453
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).
457
458
458
459
For faster startup, runtime images also automatically set aspnetcore\_urls to port 80 and use Ngen to create a native image cache of assemblies.
0 commit comments