I can successfully build and ran a demo classic asp site (given here: https://www.docker.com/blog/get-apps-off-windows-2003-cloud-docker-enterprise/) (source code is here: https://github.com/sixeyed/presentations/tree/master/docker-webinars/from-w2k3-to-cloud) with the following Dockerfile:
# escape=`
FROM microsoft/iis:windowsservercore-ltsc2016
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Install-WindowsFeature Web-ASP
COPY ./share/ClassicAspApp.zip .
RUN Expand-Archive -Path ClassicAspApp.zip -DestinationPath C:\ClassicAspApp; `
Remove-Item ClassicAspApp.zip
RUN Remove-Website -Name 'Default Web Site'; `
New-Website -Name web-app -Port 80 -PhysicalPath C:\ClassicAspApp
After building the image (docker image build -t sixeyed/w2k3-classic-asp -f .\docker\classic-asp\Dockerfile .) and running the container (docker container run -d sixeyed/w2k3-classic-asp) and then browsing to the spesific url (found by: docker container inspect ) I indeed can get the classic asp site work as expected.
However, whenever I unzip and change (even a bit) the source code in a demo asp-file (in share-folder) and then rebuild image and run the container again and browse to the url, I will always encounter http 403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied.
I have tried to find solution to this from many sources (such as IIS in Docker returning 403 and Dockerize ASP Classic on IIS) with no success so far.
Can anyone figure out why I always encounter http 403 when I change the test asp-file in the source code? So, what should be done to fix this?
I think I found a solution on my own - although I really do not yet know why changing the source code of the demo project actually led to the 403 error. But however in examining the issue I created a new simple classic asp -project in another directory and adapted the Dockerfile to these path changes like so:
# escape=`
FROM microsoft/iis:windowsservercore-ltsc2016
SHELL ["powershell", "-Command"]
RUN Install-WindowsFeature Web-ASP
RUN mkdir C:\testAsp
COPY ./code/asp/ C:\testAsp
RUN Remove-Website -Name 'Default Web Site'; `
New-Website -Name web-app -Port 8000 -PhysicalPath C:\testAsp
And after that I still received http-403 error. Then I found the following reply: 403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied and suddenly realized that because my asp-test file is not named as the default.asp -file the server is not finding it. So, my error was due to fairly naive and simple reason - at least in the second demo.
But asp-file in the first demo project was really of default type (default.asp) and therefore I do not for sure figure out why any changes in it will turn it to http-403 error. Maybe it has something to do with unzipping and zipping in between, and the server cannot find the rezipped folder with asp-file in it any more.
However, now at least the basic dockering of classic asp site works!