Docker allows us to package an application with all of its dependencies into a standardized unit for software development.
Here we are going to see the architecture of Docker. Please refer the below Docker Architecture diagram. The below image is retrieved from Docker architecture
Docker uses the client server architecture. So Docker client which is responsible for getting the request from users and connecting the Docker Daemon and running it. Docker daemon which will do all the heavy lifting tasks such as building the containers, running it.
Inside the Docker, we have the below components
Docker images is nothing but an operating system image with the web server and our application installed. This is used to create docker containers. Docker image can be built by Dockerfile. Inside the Dockerfile we can reference other images as well. Docker image is the build component of docker
Docker registries used to hold the Docker images. These are public or private stores from which you upload or download images. The public Docker registry is provided with the Docker Hub. We can also maintain Private registry which will reside inside a company’s firewall.
Docker container holds everything to run an application. Its created from a docker image.It can be started, stopped, removed, killed. Each one is isolated from other containers and also secured. We can use Docker compose for effectively managing multi container application.
When you run a Docker command with run option. It will do the below things
- It will pull the image from Docker Hub or Private registry
- Then it will create a container using that image
- Then it allocates file system and network/bridge interface
- Then it will setup the IP address. You can run docker inspect to view the IP address details and other details of a container
- It will run the task which we specified. Here its run task
- Finally it will connect to the application and transfer the application output to log file, error files