Before going over this post, if you haven’t read our previous post on What are containers, then I would highly recommend you guys to go over it.
Docker makes it easy to install and run software without needing to manually install and configure a ton of dependencies. Docker is an open-source centralized platform designed to create, deploy, and run applications. Docker uses container on the host’s operating system to run applications. It allows applications to use the same Linux kernel as a system on the host computer, rather than creating a whole virtual operating system. Containers ensure that our application works in any environment like development, test, or production.
Table of Contents
What is a Docker Container?
Docker containers are the lightweight alternatives of the virtual machine. It allows developers to package up the application with all its dependencies and libraries, and ship it as a single package. The advantage of using a docker container is that you don’t need to allocate any RAM and disk space for the applications. It automatically generates storage and space according to the application requirement.
Images
Images are basically read-only templates with instructions to create docker containers. We can get the images from the Docker hub and create containers out of it. We can also create our own images by creating dockerfile. Inside the dockerfile we will write all the instructions which will create a container with required artifacts.
Docker image has a base layer which is read-only, and the top layer can be written. When you edit a dockerfile and rebuild it, only the modified part is rebuilt in the top layer.
In the below image you can see how the Docker Engine fits into the architecture.
Components in Docker
Docker Engine follows the Client-Server architecture Lets look at the diagram and see what each component depicts.
Docker Hub
Docker Hub is the public registry where the images are stored.
Docker Registries
There are two types of registries, public registry and private registry. Docker Hub is the public registry where all the images are stored. We can also create our own private registries. With the help of docker commands the images can be pulled or pushed to these registries.
Docker Daemon
Docker daemon is a process responsible to create docker images, container etc.
Docker CLI
We use Docker CLI to enter docker commands which in turn interacts with the Docker Daemon. Docker commands make use of Docker API, Docker API or CLI is used to start, stop and delete a docker container.
Leave a Reply