I am trying to complete an architectural research on how to properly work with Windows Containers within the Azure domain/environment where I have to containerize the Dot Net Core Web API application and deploy that container into an Azure Container Service
Here are the things that I did
I did create an Azure Container Service account/domain/virtual machine within the Azure portal
Also, I did create another virtual machine for the Windows Server 2016 with Containers that already had the Docker installed
On the Windows server 2016 I did create a simple .NET Core Web API application and created an image for that application using Docker
I did push the image of the Web API application into a Docker hub and using the SSH tunnel interface tried to download the image into an Azure Container Service, so it can be run from that service
However, I would get a message that the Windows Containers cannot run on Linux as the Azure Container Service by default is a Linux system
Is there a way to deploy a Windows Docker Container into an Azure Container Service a. Should I create Azure Container Service in Windows? b. Should I use another orchestrator (NOT Docker) to deploy a Windows Container into an Azure Container Service? c. Should I go down a different path?
Thank you very much in advance for your kind support!
As we know, container about Linux and windows are different, so we can't run windows container on Linux system.
As a workaround, we can create Azure container service(choose kubernetes) with windows agent, so we can deploy windows container to kubernetes windows agent.
We can via Azure portal to deploy Azure container service, select orchestrator to kubernetes, at agent configuration, we should select operating system to windows. In this way, the master of kubernetes is Linux, and the agent is windows.
We can use
kubectl
and docker file to create windows container. For example, we can deploy IIS container on windows agent. Kubernetes is a tool which use to manage containers, so we can use k8s to deploy IIS to windows nodes.1.create
iis.json
file, like this:2.use kubctl apply command to create pods, like this:
More information about how to use k8s to deploy a windows IIS container, please refer to this link.
If you want to use your container image, you can upload your image to Azure container registry, then pull the image from your registry.
How to set secret for Azure container registry and pull image, please refer to this answer.