简体   繁体   中英

Deploying classic ASP application on IIS through Docker

I want to deploy my legacy classic asp application on IIS through docker.I am able to create image and i am able to run the image. Everything works well,but when i tried hit the IP Address ,it is not working.

I followed below steps. 1.I used below Docker file and my application placed in share folder. 2.I ran the docker file using following power shell command:

Docker file:

#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

Shell Command :
docker image build `
  -t sixeyed/w2k3-classic-asp `
  -f .\docker\classic-asp\Dockerfile .   #1.1

docker container run -d sixeyed/w2k3-classic-asp

At last i ran the docker container inspect given Container id .then it shows the all the details about the container,in that i found ip address,when i hit the ip address in the browser. Its not displaying my site.

I believe you are missing port mapping while run the container: Try like this

docker run -d -p 8081:80 sixeyed/w2k3-classic-asp

And then try accessing your website at http://localhost:8081

Note 8081 is any random port you can even map port 80 on your machine to port 80 of the container

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM