0

我正在运行一个需要启用 IIS-ASPNET 和 IIS-ASPNET45 功能的应用程序。当我在 windowsservercore 容器中运行以下命令时,它运行良好,但在 nano 服务器中失败并显示以下错误消息。

PS C:\> Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45 -all

Enable-WindowsOptionalFeature : Feature name IIS-ASPNET45 is unknown.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45 -all
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMExcepti
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand

有人可以帮忙吗,

4

1 回答 1

0

新的 Windows nanoserver 映像 (1709+) 不再具有 IIS 选项。只有旧版本可以。请参阅原始 nanoserver 图像与 1709 的比较。

这里是详细链接

PS C:\> docker run -it --rm microsoft/nanoserver powershell get-windowsoptionalfeature -FeatureName IIS-ASPNET45 -online PS C:\> docker run -it --rm microsoft/nanoserver:1709 powershell get-windowsoptionalfeature -FeatureName IIS-ASPNET45 -online C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: container 19e874a98ea8bdd2175f2f1052adadc0b8ee015178f00441e874189addf729ad encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: {"CommandLine":"powershell get-windowsoptionalfeature -FeatureName IIS-ASPNET45 -online","User":"ContainerUser","WorkingDirectory":"C:\\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[64,213]}.

于 2018-03-28T21:30:00.163 回答