Running containers with different Linux kernels

Could I seek clarification:

  • System has 16 CPUs and 128 GiB RAM
  • System is running Ubuntu 14 LTS
  • System has the latest Docker (engine and client) installed for Ubuntu 14 LTS

Can someone build and run a container that relies on Ubuntu 22 LTS running kernel version 6.x. I would says yes. However the size of the image will now include all of the binaries that Ubuntu 22 LTS has including its kernel. So when user runs the application based on Ubuntu 22 LTS, Docker will load the required binaries of Ubuntu 22 including its kernel into memory and run the specified application. In this scenario we have two copies of Linux kernel in memory, one for the Host OS (Ubuntu 14) and and another for Guest OS (Ubuntu 22).

I would think that this duplication of Linux kernel is not unique to the case when the kernels are different. They also occur when the Linux kernel of Docker container and Host OS are same. This simply follows from the requirement that the state of the container is isolated from everything else.

1 Like