0

I create a new Container Instance. I use microsoft/windowsservercore as its docker image. Everything goes ok, without error.

But then, I cannot connect to it. I need to be able to connect to it so I can enable Remote PS. Container exec does not work.

az container exec --resource-group mydocker --name servercorecontainerinstance --exec-command "cmd.exe"
Exec to container failed

Instead, if I use microsoft/iis:nanoserver docker image with the instance then, I am able to connect to it.

 az container exec --resource-group docker --name winci --exec-command "cmd.exe"
[2J[H[1H[37;40m[K[2H[K[3H[K[4H[K[5H[K[6H[K[7H[K[8H[K[9H[K[10H[K[11H[K[12H[K[13H[K[14H[K[15H[K[16H[K[17H[K[18H[K[19H[K[20H[K[1;1HMicrosoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\>

Some garbage chars show up everything else is ok.

How can I make this work with default server microsoft/windowsservercore. Or is it the wrong image for server core to try out?

Moreover, why is it so hard to find documentation on running Server Core on Azure Container Instance?

Atiq Rahman
  • 680
  • 6
  • 24

1 Answers1

0

For the images about microsoft/windowsservercore and microsoft/iis:nanoserver, the former is a Microsoft native image, but the latter is installed IIS in the Microsoft image microsoft/nanoserver.

I have a try in Azure Container Instance with both images: microsoft/windowsservercore and microsoft/nanoserver. I both cannot connect to the container instance from these images. If I create the container instance from the image microsoft/iis:windowsservercore, I also can connect to it with the command az container exec --resource-group mydocker --name servercorecontainerinstance --exec-command "cmd.exe".

So, I think if you want connect to the container from image microsoft/windowsservercore, you should install something in it. Just like the Dockerfile for IIS image from the Microsoft native image windowsserver.

Related to the difference about image windowsserver and nanoserver, you can read the document Nano Server vs. Windows Server Core.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39