About the use of container virtualization (Docker) in the Azure Cloud

Dear Readers,

Welcome to the first ever Techi-Monday blog post from the tegos Group. Each first Monday of the month, the Techi-Monday Blog is filled with an interesting topic and covers many fields of technology and cloud computing

The first article deals with containers in application virtualization – an alternative to the virtual machine. But how exactly do containers work? We explain what containers are, how they work and how they can be used productively in the Microsoft Azure Cloud to deploy applications in the cloud as cost-effectively as possible.

What is Docker and what is a container?

Docker is open source software that allows applications to be isolated in containers, similar to operating system virtualizations. A complete virtual machine that involves full OS virtualization can lead to a relatively large overhead – this can be avoided by using Docker containers because containers start much faster and require significantly fewer resources than conventional virtual machines.

An application in Docker has its own configuration and dependencies, but does not have to contain an operating system or kernel of its own. This has the advantage that Docker does not need to emulate any hardware and does not need to integrate an additional operating system instance. For this reason, containers are significantly slimmer than conventional virtual machines because they can do without starting their own operating system and run via the host instead.

VM vs Container

One of the significant advantages of docker containers is their good scalability. If additional instances of an application are required, new containers can easily be started using simple commands, and after they stop they are completely removed from the system.  Tools such as Google Kubernetes are available to orchestrate a larger number of containers.

A Case Study: Containers in the Cloud:

Now that we know what a container is and how it works, we come to the question of how to use the technology most efficiently in the cloud.

The following is a use case for the open-source asset management system „Snipe-IT„.

Snipe-IT manages the hardware inventory and lists which employee has which notebook, monitor or keyboard in their possession. To run this application, you will need PHP and a MySQL database to store the data.

Normally you would now create a virtual machine in the Microsoft Azure Cloud and install and ensure the requirements are met (PHP, PHP extensions, GD Library). That’s where Docker comes in. With the help of a Docker image we can load the application via an image that is always up to date. We also create a MySQL container that mirrors the database and also uses an image from the Docker Hub.

To start a Snipe-IT container you only need to enter a simple one-line command and Snipe-IT runs in version 4.1.13, for example. Of course, the containers still have to be linked to each other so that the MySQL database from Snipe-IT can also be used.

This is now the key point: The virtual machine (the host) now has two containers that work in isolation but are linked to each other to provide the fully functional web app. In addition to these containers, it is possible to add more containers without creating another virtual machine.

This saves time, costs and resources. Of course, you should also make sure that the host machine has sufficient resources so that no bottlenecks can occur. Using a well-equipped host in Microsoft Azure, which is what Docker runs on, is much more efficient and economical than traditional installations on multiple virtual machines.

Just try it out and set up a simple Hello World application as a container. Let us know what you think about the technology.

If you are already using it, please let us know your comments.