问题
I have a Docker image with the ASP.NET dependencies added and a website with a single index.html
.
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"]
It's build with:
docker build -t u .
and running it with:
docker run -p 9000:9000 u
When I hit http://localhost:9000
with Fiddler I get a 409 though.
回答1:
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)
来源:https://stackoverflow.com/questions/50588661/iis-in-docker-returning-403