59

It is said that docker is not a VM and containers directly run on the host.

But why do containers need a base image OS ?

If process in containers run on the base image OS , what's the difference between a VM and docker(only the base image OS can be re-used and kept read-only?)

And why does it boot faster than a VM?

What makes up a base image OS ? kernel , rootfs or both?

user2277435
  • 225
  • 2
  • 18
cola
  • 691
  • 1
  • 6
  • 15
  • 10
    Too bad that this question has been closed. I would have preferred more answers. Could the question be transferred to "Server Fault" and reopened please? – Ironori Dec 30 '15 at 22:47
  • @Sailcomp It is IMPOSSIBLE for anyone, even moderators to migrate a question that is this old. If you feel that you still need answers, ask again on another site. – Laurel May 30 '16 at 03:17

1 Answers1

21

You might want to refer to this blog post: http://www.activestate.com/blog/2013/06/solomon-hykes-explains-docker

Simply put, Docker does a process isolation leveraging LXC (a kind of lightweight virtualisation built into Linux Kernel). The basic difference between LXC and VMs is that with LXC there is only one instance of Linux Kernel running. The base image OS is used for filesystem, binaries, etc.

ondrasek
  • 288
  • 2
  • 5
  • 2
    "you would build the Ubuntu layer" in that blog post。 – cola Dec 29 '13 at 09:55
  • 3
    "you would build the Ubuntu layer" in that blog post。 It means that this layer contains Ubuntu's filesystem only ? why not use host filesystem ? And how to make sure bins in base image OS can run normally on host kernel ? Thank you. – cola Dec 29 '13 at 10:03
  • You still have a filesystem even without a base OS image. Using a base OS image is useful in situations where you need to install binaries, such as via the OS image's package manager, in the event that there isn't a docker container for it. If you don't need it, don't include it. – antimatter May 23 '16 at 23:05
  • 7
    The link no longer works. – GordonM May 27 '16 at 08:09