
Docker Architecture - Container and Image
You use Docker to deploy and run your applications with a single command bur it's a complex system that can lead to many headaches and mistakes.
11 December, 2022
7
7
0
Contributors
Introducing Docker
Docker is an open-source, container-based system for building and running applications that can run anywhere. It has become a very popular choice for developers and enterprises, who are using it to build and deploy applications in production. Docker is a container-based system that uses lightweight virtualization to create a secure, portable, and portable place to run applications without requiring the use of a virtual machine.
Docker Architecture
Docker uses a client-server architecture. The Docker client talks to the
Docker daemon, which does the heavy lifting of building, running, and
distributing your Docker containers. The Docker client and daemon can
run on the same system, or you can connect a Docker client to a remote Docker daemon.
The Docker client and daemon communicate using a REST API, over UNIX
sockets or a network interface. Another Docker client is Docker Compose,
which lets you work with applications consisting of a set of containers.
Docker Architecture
Docker is a system for running applications in containers, which means
that it can be scaled and moved to different hosts. It is a key
component of the DevOps movement, with many organizations now using it
to increase efficiency. This article will help you understand its key
concept 'Container'.
Image
Before we learn about containers, we need to first understand the ‘image’ term in Docker. If you look at the diagram above, the top layer of apps and libs/bins above the Docker daemon is encapsulated in the container. Basically, the app is packaged with libraries and binaries required by it. But how does Docker achieve this packaging?
Images are stored in a Docker registry such as registry.hub.docker.com. Because they can become quite large, images are designed to be composed of layers of other images, allowing a minimal amount of data to be sent when transferring images over the network.
Container
The Docker container is a great way to create a single application which can run on multiple servers. This allows for quicker deployment and faster updates. The Docker container also helps with security. Docker containers are great for applications which require a lot of resources or require a lot of upkeep. Docker containers are also great for applications which need to be highly-available. It is important to note that Docker containers are not as efficient as virtual machines. However, they are more efficient than traditional containers.
You might ask, how a container provides the required environment with isolation if it shares the OS kernel. Well, that is done with the help of images.
Let’s take an example here. If your app only needs Python 3.5 from the system, you will only need that in your production environment as a dependency. Everything else will be an extra overhead. So, Docker provides the template built on the Linux kernel with the needed dependencies only and nothing is installed in that template. That template is called an image.
So, if you fetch a Python 2.1 image from Docker and run an instance of it, you can do whatever you were able to do in the host machine using a command line interface. If you make any mistake with that instance, you can delete the container and create a new one from the existing image. This way, your main environment remains intact in the form of an image and you can play around with the dependencies packaged in the image using containers.
Docker Compose
Docker Compose is a tool that allows you to easily start and stop containers as needed. It is also a great way to manage your containers and their configuration. If you want to use Docker, it is highly recommended that you start using this tool. You should also use this tool if you want to share your Docker containers with other people. Using Docker Compose will make the process much easier.
Conclusion
Now you should have a clearer idea of how different these Components are. You should be able now to understand at least the surface of
most of the concepts discussed in the “Docker world.”
docker
devops
develevate