Docker Orchestration

Muhammad Rafadana Mountheira
Portelier
Published in
5 min readDec 21, 2020
https://www.droptica.com/blog/codeception-how-start-automatic-tests/

If you have been diving into computer and programming, you have probably seen the blue whale logo above. The logo above is the logo of Docker, a tool that allows developers to easily create, run, and deploy using what is called “containers”.

What is Docker?

To put it simply, Docker is a way to package software so it can run on any hardware. You may have encountered a problem where your software works on your machine but not on the others, this is probably because your software depends on different versions of libraries and any other dependencies. Docker prevents this from happening by essentially reproducing environments where it allows the developers to define what kind of environment they want.

Docker Architecture

source: https://geekflare.com/docker-architecture/

Docker uses a client-server architecture. This architecture consists of a Client, Docker Host, and Registry. The client communicates with the docker daemon and the docker daemon will do most of the work such as building and running the docker containers. Docker client and the docker daemon can run on the same machine or the client can communicate with docker daemon on a remote docker daemon. The Docker client communicates with the docker daemon using a REST API, over UNIX sockets, or a network interface.

Docker Client

Docker client enables users to communicate with the docker daemon. This the way the main way the user interacts with docker. The user can send a command such as:

docker run

and the client will send the command to the Docker daemon and the docker daemon will execute the command. A docker client can also communicate with multiple docker daemons.

Docker Daemon

Docker daemon listens to the API request and manages Docker objects such as images, containers, networks, and volumes. A daemon can also communicate with other daemons to manage Docker services.

Docker Registries

A Docker registry is a place for users to store and distribute Docker images on a server-side application. By default, Docker looks for images on Docker Hub. Docker hub is a public registry that anyone can use although you can set up and run your own private registry.

Docker Objects

You might have seen the word such as image, container, and so on. What exactly are they? below is some description of them.

Images

A docker image is a read-only template with instructions for creating a Docker container. Usually, an image is based on another image but with some additional customization, but you can also create your own images by creating a Dockerfile and write the steps needed to create and run the image. Each instruction in Dockerfile creates a layer, so if you change some of the instructions only the instructions that are changed will be rebuilt.

Container

A container is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API. Containers only have access that is defined in the image which makes it pretty well isolated.

Advantages of Docker

Portability

With docker, once you are able to contain your software and its dependencies in a container, you can deploy your software to any other system with docker and you can be sure that your software will run as you expected

Performace

Docker is more efficient compared to creating a virtual machine because it does not contain an operating system (it runs on a shared operating system) meaning that it has smaller footprints compared to virtual machines and hence, faster to create and quicker to start

Agility

Due to the benefits of portability and performance of Docker, Docker allows the development process to be more responsive and agile.

Scalability

You can quickly create new containers if demand for your software requires them. When using multiple containers you can take advantage of a range of container management options.

Isolation

Using Docker container contains all of your software including its dependencies and it is completely separated from another docker container. This means that your software will be predictable and behave as you expected throughout the development cycle.

Drawbacks

Docker is an awesome tool to use and it has a lot of benefits but it’s not a one-size-fits-all solution.

Here is some reason why you don’t want to use Docker:

If You Need to Boost Speed

Docker is lightweight, requires fewer resources compared to a virtual machine but it will use as many system resources as the host’s kernel scheduler will allow. Furthermore, it can even slow it down if you don’t set a limit to the number of resources that the container can use, it can start killing important processes in the host OS and make it unstable.

Using Different Operating Systems or Kernels

Docker image requires the same Operating System it was created for. If an image was created using Linux Ubuntu then it will only run on the same exact ubuntu. Furthermore, if you develop an application on Windows but the production runs on Linux then Docker will not work as effectively as normal.

If Security is Priority

The main security advantage of Docker is that it separates the app into smaller parts. If one part’s security is compromised, the other will not be affected. But, all containers share the same host operating system and there’s a risk that malicious code can get access to your computer memory.

If Developing a GUI application

Docker’s main focus is isolated containers with console-based applications, not Rich GUI applications. Hence GUI applications are not a priority and support for them will be limited

That is all from me! I hope you had a great time reading this article!

--

--