Understanding the difference between virtual machines and containers
Before we start installation of docker and creation of a container, it will be useful to get an understanding of why containers are different and how they are different from virtual machines.
Let's understand the basic difference between virtual machines and containers.
Virtual machines
In a virtual machine (VM), we need to install an operating system with the appropriate device drivers; hence,the footprint or size of a virtual machine is huge. A normal VM with Tomcat and Java installed may take up to 10 GB of drive space:

There's an overhead of memory management and device drivers. A VM has all the components a normal physical machine has in terms of operation.
In a VM, the hypervisor abstracts resources. Its package includes not only the application, but also the necessary binaries and libraries, and an entire guest operating system, for example, CentOS 6.7 and Windows 2003.
Cloud service providers use a hypervisor to provide...