CONTAINERS VS HYPERVISORS
Virtualisation is another way to separate applications or services – such as enabling you to easily run separate instances of applications on one physical PC. A virtual PC (whether you use Virtualbox, Vmware or any other version) emulates a full hardware stack, so every virtual instance needs a full OS installation. While you can simplify this process by copying an existing virtual machine, you cannot avoid the inevitable duplication of system files. Enterprise versions often provide tools to streamline this process, but they come at a cost.
The biggest difference is that most container platforms (including Docker as used in this tutorial) provide tools to bring your container into a known state, be that versions of libraries, configuration files or exposed network ports. In contrast, with a virtual machine you need to install the OS, install packages, copy configuration files, etc. (either manually or using a tool such as Ansible or Saltstack). Another significant advantage is volume mapping, which allows us to map a directory on our container (for example /etc/resolv.conf) to a file contained on our host file system. This feature is not only restricted to individual files, but also whole directories.
Despite this containers are not the solution to every requirement – they tend to work best when you can break a service into multiple small pieces (e.g. web database, etc.) and coordinate them via something like Docker Compose. The industry buzzword for this approach is using micro-services.