Hi Team,
We are setting environment variable like below in init.bat file.
When i do docker exec command to see inside containers i can see those environmental variable set but when IIS process(Asp.net) try to read, it doesn't find those. we are deploying containers via Service Fabric.
Below is sample docker file
FROM microsoft/iis:windowsservercore-ltsc2016
SHELL ["powershell"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET ;
Install-WindowsFeature Web-Asp-Net45
CMD init.bat
COPY webContain webContain
RUN icacls "C:\webContain" /grant IIS_IUSRS:F /T
RUN Remove-WebSite -Name 'Default Web Site'
RUN New-Website -Name 'WebContainer' -Port 84
-PhysicalPath 'c:\webContain' -ApplicationPool '.NET v4.5'
EXPOSE 84
CMD Write-Host IIS Started... ;
while ($true) { Start-Sleep -Seconds 3600 }
Below are contents of init.cmd where we set environmental variables
setx /M PATH %PATH%;C:\sffabricbin
set PATH=%PATH%;C:\sffabricbin
Thanks,
Naresh Khatri
Hi Team,
We are setting environment variable like below in init.bat file.
When i do docker exec command to see inside containers i can see those environmental variable set but when IIS process(Asp.net) try to read, it doesn't find those. we are deploying containers via Service Fabric.
Below is sample docker file
FROM microsoft/iis:windowsservercore-ltsc2016
SHELL ["powershell"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET ;
Install-WindowsFeature Web-Asp-Net45
CMD init.bat
COPY webContain webContain
RUN icacls "C:\webContain" /grant IIS_IUSRS:F /T
RUN Remove-WebSite -Name 'Default Web Site'
RUN New-Website -Name 'WebContainer' -Port 84
-PhysicalPath 'c:\webContain' -ApplicationPool '.NET v4.5'
EXPOSE 84
CMD Write-Host IIS Started... ;
while ($true) { Start-Sleep -Seconds 3600 }
Below are contents of init.cmd where we set environmental variables
setx /M PATH %PATH%;C:\sffabricbin
set PATH=%PATH%;C:\sffabricbin
Thanks,
Naresh Khatri