Hello I am Goutham here in this blog I would like to share what is docker what are some challenges it tries to solve from development to deployment of an application. This blog is only for beginners like me.
What is Docker
Before understanding what docker is let us first understand what container is, containers are the isolated environments in our local machine in which our application runs and docker is a container platform that allows to build ,test ,deploy applications quickly.
Developer team defines application code, dependencies in a file which is a docker file and with that docker images are built and this docker images are actually run in docker containers.
Docker images are just artifacts ,which means you can assume it s zip file for application code and dependencies😎
Virtual Machines are also used to run our application in isolated environment but main difference between VM's and Containers are VM's have full copy of operating systems ,application and necessary binary files that are running on host OS but Containers can run on the same machine and share host OS .
Containers are the abstraction of application layer that packages code and dependencies together.
VM's are the abstraction of physical hardware as well.
That is the fundamental difference between VM and Container.
Now as I said containers are isolated and doesn't know what's happening outside of it but to run the docker image in a container we need OS right ? Then how does it actually run the application ? Well in the docker image which is an artifact developer team besides application code ,dependencies they also include their environment as well.
Docker image basically contains every thing that needs to run application like OS, some softwares ,application code and dependencies etc..
Advantages of using Docker
Main problem it solves is that it works on machine which means if it works on my machine it definitely works on every one else machine as well .
It doesn't need full OS like VM
Other main problem it solves is that dependency management , which means we need not much care about the dependencies that the developer team has used if we are using their docker image.
Now where exactly Docker comes in DevOps cycle
Which means when we connect our Git repository to CI/CD pipe line then Jenkins a popular tool which automatically builds and tests application code and generates Docker image and pushes to DockerHub which is a place where all repositories exist.
Basic Architecture of Docker container
Through Docker CLI we try to communicate with Daemon through some commands like docker run ubuntu if it is available locally docker runs else it fetches from Docker hub registry and runs in a container.
Daemon is server it requests container runtime to perform as user requested.
Container Runtime interacts with hardware and interacts with Network for pulling image from registry...
Finally if we want to pull Node Docker image as images contain some layers which means files which are required to run that application and if some of the files are used for some other images then while pulling that image docker daemon doesn't pull those layers as they were already existing in local machine.
That's it , Thanks for reading my article if you find any thing wrong in this article please let me know.
Have a great day🎉