Running docker on a Mac
docker pull ubuntu:14.04
docker run -i -t ubuntu:14.04 /bin/bash
Linux Standard Base
root@d112db1e835e:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
My goal is to retire a dedicated laptop that I used to build some good old C code and use a docker container instead.
In order to compile my code, my Makefile
is looking to run
Makefile: /usr/bin/make -C /lib/modules/$(shell uname -r)/build M=$(PWD)/linux/$* modules
unfortunately the modules
folder is empty
mysuer@d112db1e835e:~/robot$ ls -al /lib/modules/
ls: cannot access /lib/modules/: No such file or directory
On my linux machine, I can find the modules
$ ls -al /lib/modules/
total 28
drwxr-xr-x 7 root root 4096 Dez 13 2016 .
drwxr-xr-x 24 root root 4096 Apr 24 2017 ..
drwxr-xr-x 5 root root 4096 Dez 13 2016 3.13.0-105-generic
drwxr-xr-x 5 root root 4096 Jun 23 2015 3.13.0-55-generic
drwxr-xr-x 5 root root 4096 Jul 10 2015 3.13.0-57-generic
drwxr-xr-x 5 root root 4096 Nov 3 2015 3.13.0-65-generic
drwxr-xr-x 5 root root 4096 Nov 24 2015 3.13.0-68-generic
but no modules in my docker.
On my docker
uname -r
4.9.60-linuxkit-aufs
hence
/usr/bin/make -C /lib/modules/4.9.60-linuxkit-aufs/build .... FAILS
/lib/modules/4.9.60-linuxkit-aufs
is not there.
How do I work around that?
Trying to install headers
apt-cache search linux-headers-4
linux-headers-4.2.0-18 - Header files related to Linux kernel version 4.2.0
linux-headers-4.2.0-18-generic - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-18-lowlatency - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-19 - Header files related to Linux kernel version 4.2.0
linux-headers-4.2.0-19-generic - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-19-lowlatency - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-21 - Header files related to Linux kernel version 4.2.0
linux-headers-4.2.0-21-generic - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-21-lowlatency - Linux kernel headers for version 4.2.0 on 64 bit x86 SMP
linux-headers-4.2.0-22 - Header files related to Linux kernel version 4.2.0
...
I don't find headers for 4.9.60
root@d112db1e835e:~# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-4.9.60-linuxkit-aufs
E: Couldn't find any package by regex 'linux-headers-4.9.60-linuxkit-aufs'
or
root@d112db1e835e:~# apt-cache search linux-headers-4.9
root@d112db1e835e:~#
no candidate
root@d112db1e835e:~# apt-get install linux-headers
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package linux-headers is a virtual package provided by:
linux-headers-4.4.0-1010-aws 4.4.0-1010.10
linux-headers-4.4.0-1009-aws 4.4.0-1009.9
... FILTERED ...
linux-headers-3.13.0-100-lowlatency 3.13.0-100.147
linux-headers-3.13.0-100-generic 3.13.0-100.147
You should explicitly select one to install.
E: Package 'linux-headers' has no installation candidate
root@d112db1e835e:~#
doesn't return any packages
root@d112db1e835e:~# apt-cache search linux-source
linux-source - Linux kernel source with Ubuntu patches
linux-source-3.13.0 - Linux kernel source for version 3.13.0 with Ubuntu patches
linux-headers-generic
package. When I did that,linux-headers-4.4.0-112
was also installed for me.