Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: Why use Linux containers on Windows?

I am using Win 10 Pro N (Version 1709) as a development machine and Windows Server 2016 Standard (Version 1607) as production server.

I am currently developing an ASP.NET Core 2 application with MongoDb as database.

A couple days ago I first stumbled over the idea, to run MongoDb as a Docker image.

I don't have any experience with Docker so far, but I managed to switch from Linux containers (default) to Windows containers on Windows machines.

Was this a good decision? Or is there any reason why I should use Linux containers instead of Windows containers in my scenario?

What e.g. if I should decide to deploy my application to a Linux server some time? In this case, would it wiser to start with Linux containers right from the beginning?

like image 369
Ingmar Avatar asked Jan 03 '18 15:01

Ingmar


People also ask

Can I run a Linux Docker container on Windows?

You can run both Linux and Windows programs and executables in Docker containers. The Docker platform runs natively on Linux (on x86-64, ARM and many other CPU architectures) and on Windows (x86-64). Docker Inc. builds products that let you build and run containers on Linux, Windows and macOS.

Is it better to run Docker on Windows or Linux?

Linux, is a better OS than Windows, its architecture, specially the Kernel and file system is much better than Windows. Containers take advantage of the process isolation in Linux alongside the names spaces to create isolated processes. Until recently you could only use containers in Linux.

What is the difference between Windows containers and Linux containers?

The biggest difference is the container image. Windows images are larger than Linux images. When you run your container the Docker image is downloaded and it takes a bit longer than downloading a Docker image based on Linux.

Why does Docker use Linux?

Windows and Macintosh systems can't run Linux containers directly, since they're not Linux kernels with the appropriate facilities to run even Linux programs, much less supporting the same extra cgroup facilities. So when you install Docker on these, generally it installs a Linux VM on which to run the containers.


1 Answers

Docker is not about virtualization but more about isolation.

A windows container will run on a windows host

A linux container will run on a linux host

Then some people wanted to run linux container on windows

  • First you needed to create a linux vm on windows to run the container
  • Now you can use LinuxKit to run the container but it's still a light VM

Then some people wanted to run windows container on linux

  • First you needed to create a windows vm on linux to run the container
  • Now you can use nothing more as of today

So the best bet is to start with a container aimed at your production servers

like image 194
Mumrah81 Avatar answered Oct 14 '22 21:10

Mumrah81