【发布时间】:2019-12-27 14:33:10
【问题描述】:
我正在尝试创建一个包含 IIS 的容器,该 IIS 用于托管我的 blazor 应用程序。
我使用静态 HTML 文件运行它,但是当我尝试托管 Blazor 应用程序时,我在浏览器中收到错误:
You do not have permission to view this directory or page.
或
The page cannot be displayed because an internal server error has occurred.
当我重新启动容器并查看日志时,我得到以下信息:
Service 'w3svc' has been stopped
APPCMD failed with error code 4312
Failed to update IIS configuration
当我使用一种解决方法来创建自己的入口点并启动w3svc 时,我陷入了无限循环。
我当前的 dockerfile
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-20191210-windowsservercore-ltsc2019
COPY ./dotnet/dotnet-hosting-3.1.0-win.exe .
RUN powershell ./dotnet-hosting-3.1.0-win.exe /quiet /install
RUN powershell -NoProfile -Command Remove-Item -Recurse C:\inetpub\wwwroot\*
WORKDIR /inetpub/wwwroot
COPY ./output . # Contains compiled blazor hello world project
COPY ./config.ps1 .
RUN powershell ./config.ps1 # Creates new app and pool
COPY ./ContainerRunTime.ps1 .
ENTRYPOINT ./ContainerRunTime.ps1 # C:\\ServiceMonitor.exe w3svc
我的操作系统是 WinServer 2019
【问题讨论】:
-
确保创建容器命令正确link1。你可以参考一些关于这个问题的 git hug 问题 [link2](github.com/microsoft/iis-docker/issues/154)link3link4
标签: powershell docker iis