问题描述
我正在重新运行mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019
我尝试做的第一件事是安装Print-Server
,但给我一个错误(这是我第一次使用powershell安装Windows功能):
add-WindowsFeature -Name Print-Server
add-WindowsFeature : The request to add or remove features on the specified server failed.
Installation of one or more roles,role services,or features failed.
The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source
location,see http://go.microsoft.com/fwlink/?LinkId=243077. Error: 0x800f081f
At line:1 char:1
+ add-WindowsFeature -Name Print-Services -IncludeAllSubFeature
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature],Exception
+ FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureCommand
我尝试将主机WinSxS
安装在容器中并使用sources文件夹,但出现相同的错误。
Install-WindowsFeature -Name Print-Server -Source c:\sources
我也尝试过与Enable-WindowsOptionalFeature
在线,但给我这个错误:
PS C:\> Enable-WindowsOptionalFeature -Online -FeatureName Print-Server
Enable-WindowsOptionalFeature : Feature name Print-Server is unknown.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName Print-Server
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-WindowsOptionalFeature],COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
看看其他问题,这部分内容似乎是在为其他人工作。我正在运行Windows 10企业版2004。 有人知道我该怎么办吗?
解决方法
mcr.microsoft.com/windows 映像应该是目标基础映像。 其他 Windows 容器基础映像(例如 Nano Server 和 Windows 服务器核心)不携带打印服务器角色。