Skip to content
Advertisement

Windows docker container vs Linux docker container

I am new to the Docker/Kubernetes world in general.

As i am just starting with the whole architecture i have the following:

  • Azure Container Service — up and running using Linux for master and agents
  • Docker for windows on my machine — up and running
  • automated build for a .NetCore application on VSTS using Docker task to build and push the image to the Azure Container registry
  • Kubectl running as well kubernetes UI from master nodes

when building the .NetCore application from my machine using Docker commands and then publish it to the registry, Kubernetes is able to pull it and run it, but when the image is built and pushed by the VSTS build tasks kubernetes is failing to pull the images. after researching the error a bit, it turned out that the image coming from the VSTS build is made for windows and therefor cannot be pulled.

What is the difference between Docker Container for Windows and Linux, and how can we convert or specify the type while building the image.

Advertisement

Answer

What is the difference between Docker Container for Windows and Linux.

In short, Linux docker run on Linux and work with Linux kernel, Windows docker run on windows server 2016 or windows 10, work with windows hyper virtualization, and request windows dll and other packages.

So we can’t run windows docker image on Linux docker.

how can we convert or specify the type while building the image.

As far as I know, we can’t convert the docker image to another type.

We can use VSTS to build .NET core Linux Docker image, please refer to this blog.

Also, we can use different docker platform use Docker file to build docker image.

More information about how to build windows docker image with docker file, please refer to this blog.
More information about how to build Linux docker image with docker file, please refer to this article.

After docker image created, we can follow this article to push and pull an image from Azure container registry.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement