準備一個臺windwos server 2016 ,在PowerShell 裏執行如下命令web
Install-Module DockerProvider -Force
Install-Package Docker -ProviderName DockerProvider -Force
FROM microsoft/aspnet:4.7.1 COPY ./www/ /inetpub/wwwroot RUN Add-WindowsFeature Web-IP-Security; ` powershell -NoProfile -Command Install-PackageProvider -Name NuGet -MinimumVersio 2.8.5.201 -Force; \ Install-Module -Name IISAdministration -Force; \ net user web 123456 /add ;\ net localgroup administrators web /add RUN powershell -NoProfile -Command \ Import-module IISAdministration ; \ Remove-IISSite -name 'Default Web Site' -Confirm:$false ; \ New-IISSite -Name "www.example.com" -PhysicalPath "C:\inetpub\wwwroot"
1.經過NuGet安裝 IISAdministration,這是一個IIS管理模塊,能夠經過本地的IIS管理容器中的IISdocker
2.net user web __Fm9UrD_h /add 設置用戶shell
3.net localgroup administrators web /add 設置用戶組服務器
FROM microsoft/aspnet:4.7.1 RUN mkdir /inetpub/tool COPY ./tool/ /inetpub/tool COPY ./www/ /inetpub/wwwroot RUN Add-WindowsFeature Web-IP-Security; ` certutil -importpfx -p "111111" "C:/inetpub/tool/cert.pfx";\ powershell -NoProfile -Command Install-PackageProvider -Name NuGet -MinimumVersio 2.8.5.201 -Force; \ Install-Module -Name IISAdministration -Force; \ net user web 123456 /add ;\ net localgroup administrators web /add RUN powershell -NoProfile -Command \ Import-module IISAdministration ; \ Remove-IISSite -name 'Default Web Site' -Confirm:$false ; \ New-IISSite -Name "www.example.com" -PhysicalPath "C:\inetpub\wwwroot" -BindingInformation "*:443:www.example.com" -CertificateThumbPrint "52C27E02D8EFB1BB488AEC13DB06E94EED18E539" -CertStoreLocation "Cert:\LocalMachine\My" -Protocol https
1.certutil -importpfx -p "密碼" "C:/inetpub/tool/cert.pfx"; 添加證書asp.net
2.-CertificateThumbPrint "證書指紋" ,能夠經過IIS管理器->服務器證書->查看證書->詳細信息->指紋ide
FROM microsoft/aspnet:4.7.1 RUN mkdir /inetpub/tool COPY ./tool/ /inetpub/tool COPY ./www/ /inetpub/wwwroot RUN Add-WindowsFeature Web-IP-Security; ` Start-Process ' C:\inetpub\tool\rewrite_amd64.msi' '/qn' -PassThru | Wait-Process;\ powershell -NoProfile -Command Install-PackageProvider -Name NuGet -MinimumVersio 2.8.5.201 -Force; \ Install-Module -Name IISAdministration -Force; \ net user web 123456 /add ;\ net localgroup administrators web /add RUN powershell -NoProfile -Command \ Import-module IISAdministration ; \ Remove-IISSite -name 'Default Web Site' -Confirm:$false ; \ New-IISSite -Name "www.example.com" -PhysicalPath "C:\inetpub\wwwroot"