在Windows nano服务器中启用IIS-ASPNET模块的问题

时间:2018-03-28 21:07:34

标签: windows docker docker-windows nano-server

我正在运行一个需要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

有人可以提供帮助,

1 个答案:

答案 0 :(得分:0)

新的Windows nano服务器图像(1709+)不再具有IIS选项。只有旧版本。参见原始纳米服务器图像与1709的比较。

以下是详细信息link

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]}.