Kintarō
Kintarō

Reputation: 3187

Linux headers for ubuntu docker image 18.04

I am trying to install linux header for my ubuntu 18.04 docker image (ubuntu:18.04). Usually I will do sudo apt-get install linux-headers-$(uname -r) in my VM to get the current linux header packages.

But the docker image return the following when I run uname -r

root@0c4e24cca819:/# uname -r
4.19.76-linuxkit

Just wonder which linux header image I should use for ubuntu:18.04 docker image?

Upvotes: 3

Views: 7214

Answers (1)

tripleee
tripleee

Reputation: 189749

Docker by definition runs your current kernel. If you are on a machine whose kernel has not been packaged for Ubuntu then there is no package you can install to get its headers.

Looks like you're on a Mac, so definitely that is the case here. Perhaps you could ask the Docker for Mac maintainers to provide headers for some popular platforms for their kernel, but I suspect they don't want to take on that responsibility.

As a workaround, maybe run Docker inside Linux on e.g. Virtualbox.

Upvotes: 2

Related Questions