Techso FR

Docker In a DevOps Environment

DEV

Techso possesses expertise when it comes to the open source software «Docker», thanks to its multidisciplinary team of developers. Techso offers you this short article to introduce the common usage of this technology and to explain its benefits.

Docker introduction

As a small introduction to the subject, Docker is a virtualization application based on the linux kernel. The tool notably allows it to contain an application (or several applications) with all their runtime dependencies.

Without further ado, let’s explore a little deeper the internal functioning of Docker. You will find below the main steps that allows docker to work properly.

  1. An image building request is sent (docker build) or a request to use a pre-built image is sent (docker pull, docker run).
  2. The second step consists to find the image to be run or actually build it.
    • In the case where the image is unavailable on the host machine, then the docker daemon will attempt to find it online in the configured registry (default is docker.io). A Docker registry contains pre-built images ready to be used. Once the image has been downloaded or built, continue to step 3.
    • In the case the image is available on the host machine, then we ignore the online registry and go directly to step 3.
    • In case the image has to be built, then the context (the folder tree next to the “Dockerfile”) is sent to the daemon.
  3. The image is resolved and verified (checksum comparison) and stored on the host machine in a way to make it available to the Docker daemon.
  4. This part only happens when docker run is explicitly executed. A Docker container is built with the image of step 2 and 3 and is executed on the host machine, no matter the hosting OS.

There are several ways to customize the parameters of an image, notably with environment variables (option -e), or customize the port-forwarding (option -p), or even customize the networking of the image (option –network). Docker is very flexible and permissible when it comes to customization and configuration.

Why invest in Docker and what are the benefits ?

Docker can make your life easier in several ways:

  • The tool allows you to contain a whole Backend application during either its building process, its deployment or even its execution. For instance, a server for a REST API that allows to store data on the cloud;

  • You have a client application that will not work on every operating system. For instance, Microsoft Word, given you have the licence to use it;

  • You require to use a very specific version of a database engine, without the overhead in system administration. For instance, MariaDB version 10.2;

  • You have an application written in a non-portable programming language, such as a module written in C or C++ used for legacy code compatibility;

  • You have an application on a network node available on the internet, Docker can add a layer of security between the application and the actual host operating system.
    For instance, you have an IoT application that analyzes the level of the water and is accessible via the internet on a website.

  • You use continuous integration and deployment pipelines, then Docker allows you to avoid the server management and dependency management, which is really useful for DevOps.

We are available for any question or requests concerning the virtualization using Docker. You may contact us directly for quick support.