windows - 在 windows docker 容器容器上安装 Print-Server 失败

标签 windows powershell docker-compose windows-container

我正在运行一个新的 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。
有人知道我能做什么吗?

最佳答案

From here :

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/

相关文章:

windows - 在其他PC上运行相同的power-shell命令时出错

docker - 使用 Docker 设置多个 MQTT 代理

c++ - 一般 C++ Linux 到 Windows 移植问题

c - 当 HDC 的窗口被破坏时会发生什么?

python - 用python编写命令并在powershell中执行

function - 如何在Powershell脚本中将参数化函数作为标志的别名?

regex - 在 PowerShell 中使用正则表达式提取子字符串

docker-compose with --context 不会在远程主机上重建镜像

mongodb - 带有副本集的 Mongo 容器,在 docker-compose 中只有一个节点

windows - 如何 Hook Windows 中的所有新进程