0

There are base OS images for example, for Windows and alpine linux. For these OS images, how are they making calls to the kernel? Is Docker providing some abstraction of a kernel?

Containers share the machine’s OS system kernel

https://www.docker.com/resources/what-container/

T. Webster
  • 9,605
  • 6
  • 67
  • 94
  • Containers are just processes running on the host OS kernel. There's really not all that much difference between running `ls` at your local shell and running `ls` inside a container; the latter just has a constrained view of available resources. – larsks May 05 '22 at 02:02
  • 1
    (Although note that if you're running Docker under MacOS or Windows, generally "the host kernel" is a Linux viirtual machine, not your actual host OS) – larsks May 05 '22 at 02:03
  • Where is the documentation on that? Does Docker explain this somewhere? – T. Webster May 05 '22 at 02:29
  • I'm not sure which comment you're referring to when you ask, "where is the documentation on that?" Re: "a container is just a process", I'm not sure that the docs on docker.com are explicit about that, but a search for "what is a container" will get you lots of good material. Re: "the host kernel is a Linux virtual machine", Docker is built on Linux namespace technology and hence only runs under Linux (except when you are using Docker on Windows to run Windows containers). They reference this e.g. in https://www.docker.com/blog/the-magic-behind-the-scenes-of-docker-desktop/ – larsks May 05 '22 at 02:40
  • @larsks I think his question is that i have an image that is for a containerized 32-bit Windows application built for x86, and i want to run the image on a 64-bit ARM Linux machine. The 32-bit x86 application code, and the Windows 32-bit x86 binaries can't run natively on ARM. So Docker must be providing a translation somewhere - where it converts x86 instructions to ARM instructions. Also x86 code eventually tries to access the hardware using the Windows APIs (e.g. to draw to the screen, or output sound). How is docker intercepting calls to hardware when it's not x86 hardware out there? – Ian Boyd May 05 '22 at 13:15
  • To the best of my knowledge, you can only run Windows containers on Windows (see e.g. https://stackoverflow.com/a/42185265/147356). If that's changed recently, it's not something with which I have experience. – larsks May 05 '22 at 13:32
  • @larsks no really, it is possible for some time already https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/linux-containers – Iłya Bursov May 15 '22 at 13:41
  • @IłyaBursov that's the opposite -- that's about running Linux containers on Windows, which has always been possible. I'm saying it's not possible to run Windows container on Linux. – larsks May 15 '22 at 16:13

0 Answers0