After running container by "docker run", powershell window does not accept commands

Expected behavior

After running container by “docker run”, powershell window should accept commands

Actual behavior

After running container by “docker run”, powershell window does not accept commands

Information

Service ‘w3svc’ has been stopped

Service ‘w3svc’ started

Steps to reproduce the behavior

I pulled container microsoft/iis by docker pull microsoft/iis command.
Runed this containet by docker run -it microsoft/iis command powershell
Afther that, i saw information:

Service ‘w3svc’ has been stopped

  • Service ‘w3svc’ started*

After that, powershell windows does not accept any command - when i try to type something in powershell windows where i runed container - nothing is types in the window.
How to resolve the problem ?

I am also having exactly the same issue.
Any solution, please?

I’m not an expert but following one Docker course class, this looks like a normal behavior.
For example when you run this command you get the above issue:
docker run -it --rm mcr.microsoft.com/dotnet/framework/aspnet:3.5-windowsservercore-ltsc2019
You will not get dropped into the command line, because the image is configured to start the IIS service on the Container Startup (not PowerShell) and you can not interact with the container.
Note: you can exit from that line pressing “CTRL+C” (combination at the same time).

If you wanna explore the same container image, you can run the similar command adding the PowerShell entry point and the port (to be able to have traffic with the machine), as following:
docker run -it --rm --entrypoint powershell -P mcr.microsoft.com/dotnet/framework/aspnet:3.5-windowsservercore-ltsc2019

1 Like