In this tutorial, you’ll understand the Concepts of Docker Technology. There are several important concepts we must understand before we start playing with Docker Technology. Please, read our previous article before proceeding to this article where we discussed Virtualization Technology. As part of this article, we are going to discuss the following two concepts are containers and images.
Images are read-only templates used to create containers using the Docker build command, either by us or by other Docker users. Because images can become quite large.
They are also designed to be composed of layers of other images, allowing a minimal amount of data to be sent when transferring images over the network.
So, the images are stored in a Docker registry such as Docker hub or private repositories such as Azure or AWS.
we’ll talk about containers. To use a programming expression, if an image is a class, then a container is an instance of a class, a runtime object. the containers are hopefully why you’re using Docker; they’re lightweight and portable encapsulations of an environment in which to run applications.
We create a container from an image and then run the container. And inside that container, we have all the binaries and dependencies we need to run our application.
Here are another two important concepts about Docker technology, registry, and repositories.
A registry is where we store our images, you can host your own registry, or you can use Docker’s public registry which is called DockerHub.
Inside a registry, images are stored in repositories. Docker repository is a collection of different Docker images with the same name, that have different tags, each tag usually represents a different version of the image.
Docker hub is a public registry that contains a large number of images you can use. Here, we have the link and click browse to see what we can find. this link https://hub.docker.com
As we see, there are some popular official repositories listed here. Such as Nginx, ubuntu, and Redis.
Official repositories are certified repositories by Docker technology. For each repository, we can also see the number of stars and pulls which indicates the popularity of each repository.
You can also search for other repositories here. let’s say we want to find some MySQL images, So here, Docker hub found some MySQL repositories here. Note the first one is marked as official.
Official Image Repositories
The docker new users are encouraged to use the official repositories in their projects. These repositories have clear documentation, promote best practices, and are designed for the most common use cases.
Docker, Inc. which is the company behind Docker sponsors a dedicated team that is responsible for reviewing and publishing all official repositories content. It is also ensured that security updates are applied in a timely manner for official images.
So, when we get started with Docker, try to use official images so that we can get the most support from the community. All the other repositories are also MySQL repositories which presumably contain MySQL images, They are contributed by other users in the community.
So, the official images usually come with an official mark. Also, the name of an unofficial image usually has a namespace before the actual image name which is often the user name of the user who created the repository.
Here, let’s click the link of the official MySQL repository, we can see the information about this repo and clear documents about how to use this image.
when we click the tags tab, we can see the repository has several tags.
In most of the cases, the tag means the version of the application or tool in this image.
So, an image is specified by its repository name and tag Even the same image might have multiple tags. If you don’t specify a tag, Docker will use the default tag which is the latest.
Docker Software’s Client-Server Architecture
Let’s understand a little bit about Docker’s client and server architecture. Docker technology uses a client-server architecture with the daemon being the server.
The user interacts with the daemon through the Docker client. So, the docker client is the primary user interface to Docker. It receives commands from the user and communicates back and forth with a Docker daemon.
There are two types of Docker clients.
The typical command-line client and Kitematic which is a Docker client with a graphical interface. So if you don’t like working with commands, kinematic is something you should check out.
The daemon is the persistent process that does the heavy lifting of building, running, and distributing your Docker containers. Docker daemon is often referred to as the Docker engine or Docker server. On a typical Linux installation, the Docker client, the Docker daemon, and any containers run on the same host.
we can also directly connect a Docker client to a remote Docker daemon. But you can’t run Docker natively in OSX or Windows. Because Docker daemon uses Linux-specific kernel features.
So, on OSX or Windows installation, the Docker daemon is running inside a Docker machine. The Docker machine is a lightweight Linux VM made specially to run the Docker daemon on OSX or Windows.
Thank you for reading this article, I hope you will understand the docker technology. We’ll get into more details about this when we start playing Docker run command in the next article.