It have been several days since it has been posted and yet no response. I guess you need more information to address this issue. These commands are from the dockerfile running from an Azure Windows VM (Windows Server 2022) . The docker installation is has the docker server version 27.1.1.
The reason of why you didnâT get any answer is probably that we canât answer. It is good that you came back providing more information as that often helps, but in this case I have no idea how that powershell app should work and what it rquires to run. The issue would require someone with better Windows skills and most of us (meaning active community members) work with Linux. Even on Linux just knowing the fact that an application hangs, doesnât really help much. Knowing the app itself or the sourcode in case of open source software helps more.
What I can say is that not all applications can run in containers. Or at least not without the right permissions. ON Linux, you would use Linux kernel capabilities, but I have no idea what Windows would require. It is also important that Windows containers donât support GUI applications. So if the app requires a GUI, that wonât run.
You could try to ask about it on a Microsoft forum. Or you can also search for the error message and find issues like this:
I havenât read it, but hopefully it could point you to the right direction.
yes, this is where it is stuck, there are several other RUN command following this - RUN powershell -NoProfile -ExecutionPolicy Bypass -Command âGet-ChildItem -Path .â.
As a best practice, you should try to combine as many RUN/PowerShell commands into a single one. The reason is the image will get larger since each RUN command is a new layer added to your image. The other thing is, since each image is a new container being run and executing a command, you might miss shell context from one session to the next.
My recommendation is that you either combine the RUN commands into a single one, like this:
#escape=`
FROM mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2022
RUN powershell -command `
Add-WindowsFeature Web-CertProvider; `
Add-WindowsFeature Web-Asp-Net45 -includeallsubfeature; `
Add-WindowsFeature Web-Asp-Net -includeallsubfeature
(Note: The formatting here in the forum is breaking the formatting of the dockerfile example above)
The other alternative, is to add all your commands into a .ps1 PowerShell script file, use COPY to copy the file in the dockerfile, then run the script file inside the container. Each alternative has its pros and cons and you need to see for your environment what is the best approach. Also, it might help solve the issue you are seeing.
I fixed it. Just make sure you use the code block instead of the quote button as mentioned in our formatting guide. Sometimes it requires clicking on the gear icon