Cannot start an interactive session in a DIXER container for Windows IIS

I am using the AWS image "Windows Server 2016 Base with Containers" (ami-5e6bce3e).

Using docker info , I can confirm that I have the latest version (Server Version: 1.12.2-cs-ws-beta).

From Powershell (works as Admin), I can successfully launch the "microsoft / windowsservercore" container in interactive mode by connecting to the CMD in the container:

 docker run -it microsoft/windowsservercore cmd 

When I try to launch the "microsoft / iis" container interactively, although I can connect to IIS (through a browser), I never connect to an interactive CMD session in the container.

 docker run -it -p 80:80 microsoft/iis cmd 

Instead, I just get:

W3svc service started

Using another Powershell window, I can:

 docker container ls 

... and see how my container works.

Attempt to connect locks and never returns.

Since then, I switched regions and found that there are different AMIs in each region:

  • us-east-1: ami-d08edfc7
  • us-west-2: ami-5e6bce3e

... both of them have the same result.

Used links:

Update

Using the following link, I was able to create my own server-based Docker file that installs IIS, and this seems to work fine.

custom docker file

+5
source share
1 answer

This is not a problem with AMI AWS, it was due to the fact that the Docker file for Microsoft IIS was written / was new to Docker.

Microsoft IIS DockerFile Link

Last line (line 7):

 ENTRYPOINT ["C:\\ServiceMonitor.exe", "w3svc"] 

The difference between CMD and ENTRYPOINT

Since this Dockerfile uses ENTRYPOINT, use the following command to start an interactive powershell session:

 docker run --entrypoint powershell -it -p 80:80 microsoft/iis 

Please note that it seems that the β€œ-entrypoint” flag should be after startup, as this will not work:

 docker run -it -p 80:80 microsoft/iis --entrypoint powershell 

Here is another link link regarding differences between ENTRYPOINT and CMD

+10
source

Source: https://habr.com/ru/post/1259187/


All Articles