dockerlxclxc-docker

Running docker Ubuntu image on Debian environment


Just started using Docker and have some questions regarding linux containers.

How can I run Ubuntu images on a Debian host? Or it is just a name of image called 'Ubuntu' that actually use Debian environment?

# cat /proc/version

Linux version 3.16.0-0.bpo.4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.16.7-ckt2-1~bpo70+1 (2014-12-08)

# docker run -i -t ubuntu

root@bcade5ce3b94:/# cat /proc/version

Linux version 3.16.0-0.bpo.4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.16.7-ckt2-1~bpo70+1 (2014-12-08)

What about the filesystem? Does it use the same installed components or a new fs architecture that just depends on the kernel?

Maybe there is some good articles about the subject you can share.


Solution

  • In docker all images use the same kernel - that is why overhead is minimal - virtualization layer is very thin. All files in ubuntu image from ubuntu, but any image will give you the same output of uname -a, as it is the same kernel.

    $ docker run --rm -ti  ubuntu 
    root@318f07af2ca7:/# cat /etc/lsb-release 
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=14.04
    DISTRIB_CODENAME=trusty
    DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
    

    You don't see host filesystem inside of container unless you will map some directory. The idea of container that it is running in the same way on any host - doesn't matter what installed there - you need only docker.