-2

I’m new to docker, started to learn about it but I’m a little confused.

I need to run app on windows environment.

I have Windows 7 – native Docker is only for Windows 10, so I need to download the Docker toolbox for Windows 7.

The toolbox is actually using a Linux VM to run it.

So, in this state I will actually create a container with windows environment or Linux environment?

Is the Docker for windows 10 also uses Linux?

Thanks

Matt
  • 68,711
  • 7
  • 155
  • 158
user3364652
  • 480
  • 8
  • 23
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic. See [What topics can I ask about here](https://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Server Fault](https://serverfault.com) or [Super User](https://superuser.com) would be a better place to ask about Windows and Linux native containers. – Matt Nov 14 '17 at 09:34
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Nov 14 '17 at 14:28

2 Answers2

2

To kinda answer your question: Windows 7 uses a linux to run docker because it needs certain kernelfeatures, which W7 doesn't have.

Windows 10 or Windows Server 2016 adapted to the whole containerization movement and included those features, so Windows Containers can be run from it directly.

Also the problem tgogos referenced, with windows containers not being able to run on linux hosts and vice versa is a problem which (afaik) can be solved by using an additional linux VM on the windows host, so you have both environments. I wouldn't personally recommend it, but I think it's possible.

Anyways, you won't really need this, as windows applications still will be running on Windows hosts and linux applications on linux.

Containers are mainly a more efficient, more manageable way to deploy applications.

samprog
  • 2,454
  • 1
  • 13
  • 18
0

Containers are not VMs, they rely on the host OS and this means you can't run directly:

  • a windows container on linux
  • a linux container on windows

without using some kind of virtualization that will provide the layer needed for each case. For example, Docker toolbox for Windows makes use of Oracle VM VirtualBox, in order to run linux containers.


more about Windows containers:

Windows Container Types

Windows Containers include two different container types, or runtimes.

Windows Server Containers – provide application isolation through process and namespace isolation technology. A Windows Server Container shares a kernel with the container host and all containers running on the host. These containers do not provide a hostile security boundary and should not be used to isolate untrusted code. Because of the shared kernel space, these containers require the same kernel version and configuration.

Hyper-V Isolation – expands on the isolation provided by Windows Server Containers by running each container in a highly optimized virtual machine. In this configuration, the kernel of the container host is not shared with other containers on the same host. These containers are designed for hostile multitenant hosting with the same security assurances of a virtual machine. Since these containers do not share the kernel with the host or other containers on the host, they can run kernels with different versions and configurations (with in supported versions) - for example all Windows containers on Windows 10 use Hyper-V isolation to utilize the Windows Server kernel version and configuration.

Running a container on Windows with or without Hyper-V Isolation is a runtime decision. You may elect to create the container with Hyper-V isolation initially and later at runtime choose to run it instead as a Windows Server container.

Further reading:

Community
  • 1
  • 1
tgogos
  • 23,218
  • 20
  • 96
  • 128