79
CHAPTER 4 | Development process for Docker-based applications
•
Build your own image
. In the official Docker documentation.
https://docs.docker.com/engine/tutorials/dockerimages/
•
Staying up-to-date with .NET Container Images
https://devblogs.microsoft.com/dotnet/staying-up-to-date-with-net-container-images/
•
Using .NET and Docker Together - DockerCon 2018 Update
https://devblogs.microsoft.com/dotnet/using-net-and-docker-together-dockercon-2018-
update/
Using multi-arch image repositories
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
.NET
repository available in the Docker Hub registry
provides support for Linux and Windows Nano Server by using the same repo name.
If you specify a tag, targeting a platform that is explicit like in the following cases:
•
mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim
Targets: .NET 7 runtime-only on Linux
•
mcr.microsoft.com/dotnet/aspnet:7.0-nanoserver-ltsc2022
Targets: .NET 7 runtime-only on Windows Nano Server
But, if you specify the same image name, even with the same tag, the multi-arch images (like the
aspnet
image) will use the Linux or Windows version depending on the Docker host OS you’re
deploying, as shown in the following example:
•
mcr.microsoft.com/dotnet/aspnet:7.0
Multi-arch: .NET 7 runtime-only on Linux or Windows Nano Server depending on the Docker
host OS
This way, when you pull an image from a Windows host, it will pull the Windows variant, and pulling
the same image name from a Linux host will pull the Linux variant.
Dostları ilə paylaş: