Before learning about Docker. Let’s go back in time to when we didn’t have Docker. Now, let’s say you have a small web app that you created, which is 200 MB and deployed on a server that has 1 GB of storage. Then, the whole server is only used for serving your small web app. Which means the 800 MB is lying free. You can’t use that free storage. Which means we are wasting the server resources. We are not utilizing the server Resources efficiently. To solve this particular issue, we created Hypervisor.
What is a hypervisor?
A Hypervisor is a software that lets us run multiple operating systems on a single machine in isolation. By using this Hypervisor, we can use the machine fully. We can efficiently utilize the CPU, memory and Storage of our machine. There are many benefits of using the hypervisor like speed, security, and flexibility. Each operating system runs inside a VM.
What role does Docker play?
Now, Docker is open-source software that is written in the Go language which lets developers like you and me build, run and deploy software without installing or updating any packages on our local devices using containers. Unlike VMs, Docker containers don’t need a full OS. Containers use the local host OS, which makes it lightweight and fast.
It solves a famous problem “Works on my machine.”
Let's say your friend developed a small web app which is built using the latest Node.js version and he shared the project with you, but you still have old version of Node.js. The application won’t run on your device and your friend says it works on my machine!
Docker Images, Dockerfile, and Docker Hub
Docker solves this exact issue by packing all the dependencies required to run project in a container image. Yes, literally an image is all it takes to get that project your friend has built. But, before we download, your friend has to create a Docker image and to create an image he has to write a Docker file which will contain instructions to build the application and upload this image to Docker Hub.
Now, you first have to download the image. Where will you download that from? From Docker Hub. It is where you will find all the images of different dependencies and projects. Anyone can upload an image to Hub.
Docker Engine
Now, once you download the image, you want to run it. To run it, we use Docker Engine. It is the core component that lets you build and run containers on your local machine.
After this, the project will run on your machine as it runs on your friend's machine.


Top comments (0)