Can I change the Linux kernel that Docker uses on macOS?

Viewed 1080

Q1: Can I change which Linux kernel that Docker uses on macOS?

Q2: When does Docker upgrade the Linux kernel version?

Currently, as of:

21 Sep 2020, up-to-date Docker Desktop v2.3.0.5 (48029), Engine 19.03.12

it is using Linux kernel 4.19.76 (released 22 Oct 2018). I expected it to be on a more recent kernel
(e.g., Linux 5.8 was released 2 Aug 2020; Linux 5.0 was release 3 Mar 2019).

$ docker run -it alpine uname -a
Linux f745312f5a3e 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2020 x86_64 Linux

Related:
How does Docker run a Linux kernel under macOS host?
Can I change the kernel used in Docker for Windows?
https://kernelnewbies.org/LinuxVersions

2 Answers

Q1: Can I change which Linux kernel that Docker uses on macOS?

Safe and simple answer: No. Unless you want to mess-up directly with the Hyperkit VM that docker desktop for Mac is deploying for you when installing. I don't use Mac, I have no clue it this is even possible and strongly suggest you don't walk that path unless you seriously know what your are doing and are ready to reinstall everything if this breaks.

Q2: When does Docker upgrade the Linux kernel version?

When that change is incorporated to a new release and announced on the Docker for mac release notes. Latest kernel upgrade was made on 2020-05-27.

That being said, docker only uses the underlying kernel of the OS/VM where it is installed. If you really need a different kernel for a very specific reason, you can always deploy in parallel your own custom vm with the exact kernel you want, install a docker engine there and use it.

Related