Docker Orchestration

Oliver Muhammad Fadhlurrahman
Portelier
Published in
5 min readDec 19, 2020
Source: https://www.docker.com/blog/announcing-docker-machine-swarm-and-compose-for-orchestrating-distributed-apps/

If you’re a programmer, you may have seen logo of a cute blue whale holding containers on top of it. This is the logo of a platform called docker. So, what is Docker you may ask. According to Docker’s official documentation,

“Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.”

As said above, Docker is a platform where we can develop, ship, and run applications in a loosely isolated environment called a container. This container allows developers to package their application with all the part it needs, such as libraries and other dependencies. This package then can be deployed as one and will then be stored inside a container. Containers are lightweight because extra load of hypervisor aren’t needed, they run directlyw within the host’s kernel.

Docker Architecture

Docker uses a client-server architecture, docker client talks to the Docker daemon which does the building, running, and distribution of Docker containers. Docker client and docker daemon can either be run on the same system or the client can be connected to a remote daemon. Docker client and daemon communicate with each other using a REST API, through UNIX sockets or network interface.

Source: https://alanhou.org/homepage/wp-content/uploads/2018/04/

Docker Daemon

Docker daemon is the one that listens to Docker API requests and manages Docker objects such as container, networks, images, and volumes. Docker daemon can also communicate with other daemons in order to manage Docker services.

Docker Client

Docker users will mainly interact with Docker through Docker client. Docker client communicate with daemons. For example when a command, such as docker run is used, the client will send the commands to the one that will carry them out, the docker daemon.

Docker Registries

Docker registry is a server side application that let users store and distribute docker images. Docker Hub for example is a public registry that can be used by anyone. By default, Docker is configured to search for images on Docker Hub.

Docker Benefits

Consistent and Isolated Environment

By using containers, developers can create predictable environments that are isolated from other applications. Wherever the app is deployed, everything will remain consistent and this can lead to massive productivity. Meaning less time spent on debugging and more time on launching features and functionalities.

Cost-effectiveness with Fast Deployment

Docker containers can decrease deployment time by a significant amount. Also when each process is put into a container, it can be shared with new applications. The process of deployment becomes very swift.

Mobility

Docker images are free of environment limitations, which makes deployment consistent, portable, and scalable. Containers can also run anywhere, providing that it’s targeted at the OS.

Flexibility

When we need to perform an upgrade during a product’s release cycle, we can make the necessary changes to Docker, test them, and roll out new containers. Docker allows us to build, test, and release images that can be deployed across multiple servers.

Collaboration, Modularity, and Scaling

Docker containerization allows us to segment an application so that we can refresh, clean up, and repair without taking down tan entire application. With Docker we can also build an architecture for applications that compromise of small processes that communicate with each other through APIs. With this, developers can share and collaborate, solving issues quickly.

In spite of all these benefits, there are some situations where we shouldn’t use Docker. Here are some of them.

If we need to boost speed

Docker containers are small and needs fewer resources than a VM with a server and database, but it will use as much system resources as the host’s kernel scheduler allow.

If prioritizing security

One of the security advantage of Docker is that it breaks an app into smaller parts. If one part’s security is compromised, the rest won’t be affected. That said, all containers share access to single host OS. We risk running Docker containers with incomplete isolation. Malicious code can get access to our computer memory.

If developing a desktop GUI application

Docker isn’t suited for applications that require rich UI. It’s mainly intended for isolated containers with console-based applications. GUI based applications aren’t a priority, their support will rely on specific case and application.

If we want to facilitate development

Docker provides environment stability, a container on the development will work exactly the same on staging, production, or other environments. At the same time, we need some extra setup to code our app in Docker. Also with Docker debugging we have to configure logs output and setup debugging ports. In summary if we have a complicated deployment process, Docker will help a lot. But if we only have a simple application, Docker just adds unnecessary complexity.

If we need to use different OSs or kernels

Docker images requires the same operating system it was created for. For example if an app is developed on Windows, but the production runs on Linux, we won’t be able to use Docker effectively.

If there’s a lot of valuable data to store

All Docker files are created inside a container and stored on a writable container layer. It can be difficult if we want to retrieve data out of the container if a different process needs it. The writable layer is also connected to the host machine which the container is running on, so if we need to move the data elsewhere it can’t be done easily. Also when the container shuts down, all data stored inside it will be lost.

--

--