Docker中的IIS返回403 [英] IIS in Docker returning 403
本文介绍了Docker中的IIS返回403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个添加了ASP.NET依赖项的Docker映像,以及一个具有单个 index.html
的网站.
I have a Docker image with the ASP.NET dependencies added and a website with a single index.html
.
DockerFile是:
The DockerFile is:
# escape=`
FROM iis-with-asp
ADD ./Ping C:/Ping
RUN ["C:\\Windows\\System32\\icacls.exe", "\"C:\\Ping\"", "/grant", "\"IIS AppPool\\DefaultAppPool\":(OI)(CI)", "/T"]
RUN ["C:\\Windows\\System32\\icacls.exe", "\"C:\\Ping\"", "/grant", "\"IIS_IUSRS\":(OI)(CI)", "/T"]
RUN ["C:\\Windows\\System32\\icacls.exe", "\"C:\\Ping\"", "/grant", "\"Network Service\":(OI)(CI)", "/T"]
RUN ["\\Windows\\system32\\inetsrv\\AppCmd.exe", "add", "sites", "/name:\"Ping\"", "/id:2", "/bindings:http://localhost:9000", "/physicalPath:C:\\Ping"]
EXPOSE 9000
RUN ["\\Windows\\system32\\inetsrv\\AppCmd.exe", "list", "site"]
它的构建与:
docker build -t u .
并运行:
docker run -p 9000:9000 u
当我用Fiddler击 http://localhost:9000
时,我得到了409.
When I hit http://localhost:9000
with Fiddler I get a 409 though.
推荐答案
您将9000端口暴露给主机,您应该仅使用9000端口进行访问,但请确保导出正确的应用程序端口.例如:(主机)9000:5000(应用端口)
your exposing 9000 port to host machine, you should access with 9000 port only but make sure that you're exporting correct application port. ex: (host machine)9000:5000(app port)
这篇关于Docker中的IIS返回403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文