Think of Docker like magic containers for your computer applications.
You know when you move in to a new house, you have to pack up all your stuff into boxes so you can transport it! Docker is the same but for software.
Another great way to think about it, is those ready to make meal services in a box. You are the chef, and you have all the ingredients you want to use to cook a meal delivered to you right in a ready to go box.
What is the difference between Docker and Virtual machines
Here are some principal differences that differentiate Docker from Virtual machines.
The architecture: While Docker uses containerization, VM's use hypervisors. Docker containers are very light and a good way to package applications and related dependencies where VM's actually emulate an entire computer system.
Resource Usage: Docker containers share the host operating systems kernel, which makes them very light compare to virtual machines. VM's however, require a separate operating system for each instance which results in higher performance costs.
Isolation: Docker containers provide process-level isolation only. This means that each Docker container runs its own processes independently from the host, as well other containers. Virtual machines however, provide full isolation capabilities which means each VM has its own virtual hardware and operating system.
Deployment: Docker containers can be deployed more quickly and easily than VM's because they are smaller and require fewer resources. With Docker Composer, it is simple to deploy multiple containers on a single host. VM's however require considerable resources and take much longer to deploy.
Portability: Docker containers are portable and can run on any system that supports Docker. VM's on the other hand, require specialized software to run, which makes them less portable.
Still don't understand, here are some analogies.
Docker containers are like shipping containers, while VM's are like a fully furnished house. Shipping containers are designed to transport goods effectively and are standardized in size and shape, making them highly portal and easy to move around. Likewise, Docker containers are very lightweight and standardized, making them easy to deploy and move around between several systems. A fully furnished house on the other hand, is much larger and complex requiring more resources and time to move.
Docker containers are like cars, while VM's are like buses. Cars are smaller and more nimble, and can get you where you need to go quickly and efficiently. Similarly, Docker containers are small and lightweight, making the mfaster and easier to deploy, like a sports car. Buses on the other hand are large and complex, they require large resource sand time to move large amount of people. If you think of each one of those people as an application, the Docker container is the sports car, getting just 1 app to a level of deployment very quickly, whereas a VM is used for many functions, applications and services.
Docker containers are like book chapters while VM's are the entire book. A book chapter is a small piece of a much larger volume of work that can stand on its own, like a mini story, but also apart of a larger story. Similarly, Docker contrainers are self-contrained units that can run independently, but can also be combined with other containers to form a larger application. An entire book, on the other hand, is a complex work that requires considerable resources adn time to read and understad. Similarly, VM's are entire computer systems taht require more resources adn time to setuyp and amange than docker.
Docker registries are a must know
Have you used GitHub before? Then this should come as second nature.
Think of Docker registries as a central library where Docker images can be stored and shared. Much like a library, anyone with a library card can check a book in or out. The same goes for Docker and anyone who has access.
There are two types of Docker registries: public and private. Public registries, like Docker Hub, allow anyone to upload and download Docker images, Private registries howeverm are hosted by organizations and used to store and distribute images within a closed environment, such as their internal work.
When using Docker you can pull images from public and private registries, much like github. For example, if you wanted to use Ubuntu, you would pull it from the public Docker Hub registry with the "docker pull ubuntu latest" command.
Alternatively, you can create your own custom images and publish them to a registry of your choice.