我正在运行一个新的 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
并使用源文件夹,但我得到了同样的错误。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 Enterprise 2004。有人知道我能做什么吗?
最佳答案
The mcr.microsoft.com/windows image should be the targeted base image. Other Windows container base images (such as Nano Server and Windows Server Core) do not carry the Printing Server Role.
关于windows - 在 windows docker 容器容器上安装 Print-Server 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64234710/