Operating Systems has 2 layers

  1. OS Kernel - communicates with Hardware - CPU, memory etc
  2. Applications layer

For example, Multiple versions of linux exist which use same linux kernel but they implement different applications on top of their kernel

Different levels of absrtaction

  • Docker and VM are both virtualization tools
    • Docker : virtualises Applications layer of OS while using the kernel of host
    • VM : Virtualises whole OS (Applications layer + OS kernel)
  • Size : Docker image size is much smaller due to this.
    • Docker images in MBs, while Vm are in GBs
  • Speed : Docker containers start and run much fast.
  • Compatibility : VM of any OS can run on any OS host

Why linux based docker containers don’t run on windows

  • Host - Windows OS (Applications + Kernel)
  • Linux based image (Aplpications layer) might not be compatible with Host OS kernel
  • Check whether Host can run docker natively, ie. check if your os kernel is compatible with docker images.
  • Workaround - Use Docker Toolbox to abstract way kernel to allow host run the docker images

docker-vs-vm

7-layers

OSI-7-layers