gpt4 book ai didi

在 IIS 上 Dockerize ASP Classic

转载 作者:IT老高 更新时间:2023-10-28 12:40:27 24 4
gpt4 key购买 nike

Microsoft 一直在投资使用 Docker Desktop for Windows 在 Windows 上运行 docker。是否可以通过 Docker 在 IIS 上运行旧版 ASP Classic 应用程序?怎么样?

https://hub.docker.com/r/microsoft/iis/

最佳答案

我终于让这一切正常了。它比运行一个简单的 Dockerfile 复杂得多,因为它最初是在 2002 年开发的。有一些模块需要下载和安装,web.config 部分需要解锁,以及 ODBC 数据连接必须制作。我最终的 docker 文件看起来像这样 - 希望它可以帮助下一个人!

# escape=`

FROM mcr.microsoft.com/windows/servercore/iis
SHELL ["powershell", "-command"]

RUN Install-WindowsFeature Web-ASP; `
Install-WindowsFeature Web-CGI; `
Install-WindowsFeature Web-ISAPI-Ext; `
Install-WindowsFeature Web-ISAPI-Filter; `
Install-WindowsFeature Web-Includes; `
Install-WindowsFeature Web-HTTP-Errors; `
Install-WindowsFeature Web-Common-HTTP; `
Install-WindowsFeature Web-Performance; `
Install-WindowsFeature WAS; `
Import-module IISAdministration;

RUN md c:/msi;

RUN Invoke-WebRequest 'http://download.microsoft.com/download/C/9/E/C9E8180D-4E51-40A6-A9BF-776990D8BCA9/rewrite_amd64.msi' -OutFile c:/msi/urlrewrite2.msi; `
Start-Process 'c:/msi/urlrewrite2.msi' '/qn' -PassThru | Wait-Process;

RUN Invoke-WebRequest 'https://download.microsoft.com/download/1/E/7/1E7B1181-3974-4B29-9A47-CC857B271AA2/English/X64/msodbcsql.msi' -OutFile c:/msi/msodbcsql.msi;
RUN ["cmd", "/S", "/C", "c:\\windows\\syswow64\\msiexec", "/i", "c:\\msi\\msodbcsql.msi", "IACCEPTMSODBCSQLLICENSETERMS=YES", "ADDLOCAL=ALL", "/qn"];

EXPOSE 8000
RUN Remove-Website -Name 'Default Web Site'; `
md c:\mywebsite; `
New-IISSite -Name "mywebsite" `
-PhysicalPath 'c:\mywebsite' `
-BindingInformation "*:8000:";

RUN & c:\windows\system32\inetsrv\appcmd.exe `
unlock config `
/section:system.webServer/asp

RUN & c:\windows\system32\inetsrv\appcmd.exe `
unlock config `
/section:system.webServer/handlers

RUN & c:\windows\system32\inetsrv\appcmd.exe `
unlock config `
/section:system.webServer/modules

RUN Add-OdbcDsn -Name "mywebsite" `
-DriverName "\"ODBC Driver 13 For SQL Server\"" `
-DsnType "System" `
-SetPropertyValue @("\"Server=XXXX.us-east-2.rds.amazonaws.com\"", "\"Trusted_Connection=No\"");

ADD . c:\mywebsite

关于在 IIS 上 Dockerize ASP Classic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40099339/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com