Why kernel version doesn't match Ubuntu version in a Docker container?

10,185

From What is Docker?:

LIGHTWEIGHT

Containers running on a single machine share the same operating system kernel; they start instantly and use less RAM. Images are constructed from layered filesystems and share common files, making disk usage and image downloads much more efficient.

Containers run on the host OS kernel. In your case, the host could be a Ubuntu 14.04 (running the original kernel) or a Ubuntu 12.04 (running kernel from trusty's hardware enablement stack).

If the host is Ubuntu 14.04 you could install kernel 3.16:

sudo apt-get install linux-generic-lts-utopic

Or kernel 3.19:

sudo apt-get install linux-generic-lts-vivid

For Ubuntu 12.04, kernel 3.13 is latest official one.

Share:
10,185

Related videos on Youtube

jcm
Author by

jcm

Updated on September 18, 2022

Comments

  • jcm
    jcm over 1 year

    I have a Docker container built from Ubuntu 14.10. When I log in to the container to check the Ubuntu version and kernel version I see the following:

    root@~$>> lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 14.10
    Release:    14.10
    Codename:   utopic   
    
    root@~$>> uname -a
        Linux ambiata-aws 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
    

    I thought that Ubuntu 14.10 was supposed to be kernel version 3.16 (as stated here), so why do I have kernel version 3.13.0-24-generic ?

    The reason I am asking is because there is a patch in 3.13.0-29-generic that I would like to have (that is, having fallocate working on AUFS in my docker container) which is discussed here.

    • saiarcot895
      saiarcot895 almost 9 years
      Is the container running on Ubuntu Trusty? If so, that would be why.
  • jcm
    jcm almost 9 years
    Do you mean I would have to upgrade the host kernel? There's no way to just upgrade the container's kernel?
  • Eric Carvalho
    Eric Carvalho almost 9 years
    @jcm There's no kernel inside a container. Even if you install a kernel, it won't be loaded when the container starts. The very purpose of a container is to isolate processes without the need to run a new kernel. That is also why containers are restricted to Linux. If you need to run another OS or another kernel version you have to make use of virtualization.