Ahoy Captain, or a Few Words About Virtualization and Containerization
Virtualization and containerization are processes intended to improve software development, help deliver solutions smoothly to production, and as a result save a huge amount of time.

From this article you will learn:
- What does it mean for software to be open source?
- What is virtualization about?
- What is containerization?
- Who is a Docker Captain?
When I joined a small company located in the Adam Mickiewicz University Science and Technology Park in Poznan in November 2014, I did not expect programming to be about more than solving problems caused by code. Even though I had already been building websites and putting them on servers for several years, my knowledge was still rather limited. Limited enough that the long list of complex dependencies needed to prepare an environment for running almost any application did not mean much to me yet.
The opportunity I received from Krzysztof and Szymon at Light4website was a huge beginning for me. The thing is, on the very first day, an obstacle appeared on the horizon - Ubuntu.
What Is the Deal With Ubuntu?
Ubuntu is one of the most popular distributions of the Linux operating system. Linux, in turn, is an operating system that resembles Unix in its structure, a system developed since 1969. The name Linux is also used for a family of operating systems that use the Linux kernel - free software created by Linus Torvalds. This is important in the context of today's article, because the Linux kernel is responsible, among other things, for communication between the system and drivers and programs, as well as for launching them and handling the file system. In other words, it is quite an important part of the Linux operating system.
The idea of free software is based on respecting users' freedom in relation to the program they use. In practice, it means that the community can study, develop, duplicate, run, and modify the software it uses. When we combine both of these aspects, we get an operating system that gives its users a lot of freedom, while also counting on their responsibility and understanding of what they use and why. That is Ubuntu as well.
You can do anything, including breaking everything.
First Contact
The projects I worked on at Light4website were built on Magento or Wordpress, which meant that, at minimum, they needed a PHP interpreter to run. Installing the PHP interpreter itself allows our computer to understand and execute the code we write, but it still does not let us display the whole website on our device. For that, we need more tools, for example Apache, a popular HTTP server, and a MySQL database. Not to mention local domain configuration, directory setup, access, and permissions. And if we add the fact that every project may require different versions of the tools mentioned above, we end up with a huge number of possible software configurations on a single machine. It is not easy.
Of course, we will run into the same problem on operating systems from the Windows or macOS families.
Virtualization
Imagine a situation where the application being developed uses several different programming languages. Or even better - the application is split into smaller services, and each of them uses a different version of a given language and has completely different requirements when it comes to software versions. The examples above create many problems, not only while developing software, but also while maintaining it and publishing it on servers. Setting this up once can take a lot of time. Moving everything to a new place without mistakes would be very difficult and would require a lot of attention, which still would not guarantee that we did it perfectly. And updates? Eh...
What if we separated a fragment of the resources available on our computer, or possibly on a server, and isolated that layer so that it stored only one possible configuration? Moving the whole thing or updating software on that layer should then have no impact on other parts of the system.
Pros and Cons of Virtualization
The process I mentioned is called virtualization. Thanks to it, resources such as the processor, RAM, and disk can be divided into many virtual devices. This kind of simulation requires preparing an entire environment, sometimes including the operating system, from scratch within the allocated resources. As a result, it helps increase the scalability of created solutions, minimize the number of servers needed, reduce infrastructure costs, and, through isolation, improve security, creating a complete, secure, and independent environment.
It might seem, then, that virtualization solves all the problems we discussed in the introduction. Unfortunately, it also has its drawbacks. Applications running inside a virtual machine (VM) are less efficient than applications running on physical hardware. This is mainly because there is an additional abstraction layer between the application and the server in the form of the virtual machine's own operating system. In addition, between the base operating system and the virtual environment there is a program responsible for supervising and controlling the VM's work, called a hypervisor. Its work also introduces latency.
Containerization
What if we kept the advantages of virtualization while reducing the number of abstraction layers? Containerization assumes that there is no need to allocate resources only for the containers we create. Containers operate within one kernel of the same operating system. Each container still has its own file system, which gives it the independence it needs. The fact that containers are isolated from the operating system and from one another means they keep the advantages of virtual machines while also being exceptionally lightweight, because they use only as many resources as they actually need. In addition, containers can exchange information through precisely defined communication channels, which is not possible between different virtual machines.
The downside of containerization, however, is that it makes our containers dependent on the operating system on which they are launched. This is often solved by using a hybrid approach - a VM with the required operating system, and containers inside it. Another important drawback is the fact that containerization does not offer full container isolation of the kind we can achieve with a virtual machine.
Docker
The most commonly used tool for containerization is Docker, although it is not the only one. Docker is free software, which gives its users broad possibilities to modify it for their own needs and to participate in its development. As a platform, it lets us create a consistent configuration for our containers' runtime environment. That, in turn, means that regardless of where they are launched, we have a guarantee that they will work the same way everywhere. In other words, thanks to Docker, we can forget about putting specific configurations on a server, because the containers we run know best what they need and how it should be set up.
Docker can run only on the Linux kernel, which means that using Docker on other operating systems involves a hybrid approach. We can do this with Docker Desktop, which creates a virtual machine inside which the containers are launched.
Recommended book: Learn Docker in a Month of Lunches, Elton Stoneman
A Mature Solution
It is worth mentioning that the tools offered as part of Docker are very mature. The first version was released in 2013 as open source under the name Docker Engine. The organization responsible for its development makes sure that we have a wide choice of supporting tools. As part of its activity, it also prepared a repository of Docker images (Docker Hub), which we can download and use for our own needs if we do not want to play with configuration on our own.
In addition, the best members of the community gathered around the project, people distinguished by their knowledge and activity around the project itself, are selected and receive the title of Docker Captain. It is a significant distinction. As of today, in Poland we have only two people who hold this title. The first was Łukasz Lach, and quite recently Damian Naprawa has been able to boast of it as well.
Summary
We should remember that containerization is not an extension of virtualization. These are different approaches, each with its own advantages and disadvantages, and therefore they should be used with the requirements of the project in mind. It is worth mentioning that even the best concept can be used poorly.
When I joined Light4website, Docker was starting to get a lot of attention. We were working on virtual machines at the time, but does that mean it was a bad approach? Definitely not - it was simply enough for our needs at that moment. It is always worth keeping common sense.
Sources
- Containerization and Virtualization in a Company
- Docker - The Basic Idea (Virtualization vs. Containerization)
- What Is Virtualization?
- Docker for Developers, What Is It?
- What is a Container?
- Docker Captains
- Containerization, or How Valuable Time Is
- 10 Things You Should Avoid When Containerizing
- Docker - What Is Containerization and Why Can It Be Useful in Your Company?
- Containerization - What Are Containers and Where Does Their Popularity Come From?
- Containerization - What Is It and Why Is It Becoming So Popular?




Comments (0)
No one has posted anything yet, but that means.... you may be the first.