4

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.

BaCaRoZzo
  • 7,502
  • 6
  • 51
  • 82
dima.h
  • 860
  • 2
  • 10
  • 14

1 Answers1

6

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.

ISanych
  • 21,590
  • 4
  • 32
  • 52
  • So i am just running Ubuntu on a same kernel that uses Debian ? – dima.h Jan 14 '15 at 17:59
  • @dima.h yes - ubuntu, centos, gentoo use host kernel (Debian in your case). – ISanych Jan 14 '15 at 18:01
  • i see that ubuntu is based on debian but the centos and gentoo is not ... how can they use debian kernel ? is it compatible ? – dima.h Jan 14 '15 at 18:11
  • 2
    @dima.h yes, it will be very rare case when something is not working, see an answer here for example - http://stackoverflow.com/questions/23945109/what-will-be-impacted-for-compiling-code-in-different-kernel-in-docker – ISanych Jan 14 '15 at 18:15