I had the same issue and it link to the way the IIS team build the image using ServiceMonitor.exe. You cannot use another apppool than DefaultApplicationPool. I guess it is mention on the iis team github.
In my case I had to use windows server image unstead of iis image.
Here the part of my Dockerfile that install the IIS components I need :
# escape=`
FROM microsoft/windowsservercore:1709
...
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; "]
RUN Add-WindowsFeature Web-Server, Web-Http-Redirect, Web-Http-Tracing, Web-Dyn-Compression, Web-Windows-Auth, Web-Asp, NET-Framework-45-ASPNET, NET-WCF-HTTP-Activation45, Web-Asp-Net45;
RUN c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/log /centralLogFileMode:"CentralW3C" /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/log /centralW3CLogFile.truncateSize:4294967295 /commit:apphost; `
c:\Windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/log /centralW3CLogFile.period:"MaxSize" /commit:apphost;
...
ENTRYPOINT C:\EntryPoint.ps1 -Verbose
The entry point script configure OS for the app and finish by showing logs
Hi @sk5277, was able to create a image using the above script. But after running the container, how to browse the hosted site with the exposed port? Can you please guide me?
docker container ls #to find the name/container id of the running container
docker inspect -f “{{ .NetworkSettings.Networks.nat.IPAddress }}” <containerId/name recievd from above step
xxx.xxx.xxx.xxx
Now, open your browser and use this ip address along with the port exposed to access the hosted IIS website