Before going to docker let’s see what a VM is and what a container means which will help you to understand what docker is and its purpose.
Virtual Machine: In general terms, VM is a machine that enables you to install an operating system over any system. Through this user can use both the local machine and also the virtual machine. In technical terms, It is like building a PC, with its core components like CPU, RAM, Disks, Network Cards, etc, within an operating system and assemble them to work as if it was a real PC.
Container: This is the same as the virtual machine but the difference is instead of using a whole operating system it removes the unnecessary components of the operating system and launches minimal version of it. This leads to the creation of Linux Containers.and these are faster than Virtual Machine.
Docker: A docker container, unlike a virtual machine and container, does not require to include a separate operating system. Instead, it relies on the Linux kernel's functionality and uses resource isolation.
Purpose of docker: Its primary objective is to automate the deployment of application inside software containers and this automation is done on Linux. These docker containers are more lightweight and that helps to boot up in seconds.
For more details on docker go through this professionally designed course: https://intellipaat.com/devops-certification-training/