Reputation: 15138
I want to install the donet Framework 4.6.1 int the microsoft/dotnet:latest image (this image is needed for .net core, but I need also the framework)
Upvotes: 4
Views: 16355
Reputation: 3965
First, it's recommended to update your tag usage to reference the MCR location (see https://github.com/dotnet/announcements/issues/101) because microsoft/dotnet:latest
is no longer being updated and still points to .NET Core 2.1 instead of 3.1. So the recommendation is to use mcr.microsoft.com/dotnet/sdk:3.1
if you want the latest .NET Core image. See the Docker Hub page for all supported tags.
Second, the .NET Core Docker images are only available for Windows Nano Server, which is a subset of Windows Server Core. .NET Framework requires at least Windows Server Core. So there's not a way to install .NET Framework onto a .NET Core image that uses Nano Server. There is an existing proposal to also publish .NET Core images that are built on Windows Server Core but no such images exist today. [EDIT: Images for .NET 5.0 are now available on Windows Server Core 2019]
What would make more sense is to start with the .NET Framework Docker image which is built on Windows Server Core and then add .NET Core 3.1 to it. Guidance for how to install .NET Core in a Dockerfile can be found at https://github.com/dotnet/dotnet-docker/blob/master/documentation/scenarios/installing-dotnet.md. Do you really need 4.6.1 or is 4.6.2 sufficient? Because there's only a supported Docker image for 4.6.2 but not 4.6.1. The oldest supported version of Windows Server Core is LTSC 2016 which has 4.6.2 installed on it by default.
Upvotes: 15