如何在Docker中安装.net Framework? [英] How to install .net Framework in docker?

查看:79
本文介绍了如何在Docker中安装.net Framework?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Microsoft/dotnet:latest映像中安装donet Framework 4.6.1(.net核心需要此映像,但我也需要框架)

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)

推荐答案

首先,建议更新标签用法以引用MCR位置(请参见 Docker Hub页面.

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/core/sdk:3.1 if you want the latest .NET Core image. See the Docker Hub page for all supported tags.

第二,.NET Core Docker映像仅可用于Windows Nano Server,后者是Windows Server Core的子集..NET Framework至少需要Windows Server Core.因此,没有办法将.NET Framework安装到使用Nano Server的.NET Core映像上.有一个现有的提案也可以发布基于.NET Core映像Windows Server Core,但今天不存在此类映像.

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.

更有意义的是从 .NET Framework Docker映像开始基于Windows Server Core构建,然后向其中添加.NET Core 3.1.可以在 https://github.com/dotnet/dotnet-docker/blob/master/documentation/scenarios/installing-dotnet.md .您真的需要4.6.1还是4.6.2足够?因为仅支持4.6.2而不是4.6.1的Docker映像.Windows Server Core支持的最早版本是LTSC 2016,默认情况下已安装4.6.2.

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.

这篇关于如何在Docker中安装.net Framework?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆