I am running an image that's running on several amd64 servers and on a brand new RPI4.

One of the things that's needed are the kernel headers.

The image is being pulled is FROM debian:stable-slim. On Debian this command works fine apt-get install -y linux-headers-$(uname -r) but that doesn't work on Raspbian.

I could modify the script to install raspberrypi-kernel-headers instead -- but that's not available on Debian.

What would be the best way to install RPi kernel headers in a Debian container?

1 Answer 1


I added the raspbian and rpi repos.

echo "deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi" > /etc/apt/sources.list.d/rpi.list
echo "deb http://archive.raspberrypi.org/debian/ buster main" >> /etc/apt/sources.list.d/rpi.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9165938D90FDDD2E
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 82B129927FA3303E

I execute a different run.sh from my Dockerfile depending on the arch of the machine.

That works, so all good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.