Schematischer Vergleich: links ein Server mit drei virtuellen Maschinen, jede mit eigenem vollständigem Betriebssystem; rechts derselbe Server mit einem gemeinsamen Betriebssystemkern, darüber eine Container-Laufzeitumgebung und darauf fünf schlanke Container mit je einer Anwendung.

Containerization

Containerization is a technique in which a program, together with everything it needs to run, is packed into a self-contained package. This package runs the same way on any suitable computer – on the developer's laptop just as on a server in a data center.

A program usually needs more than itself to function. It needs certain helper programs, certain versions of them, and certain settings. If one of these is missing on another computer, the program crashes or behaves strangely. Containerization solves this problem by packing the program together with all these ingredients into a self-contained package. This package is called a container, and it runs the same way everywhere the right software for playing it back is installed. Developers like to describe this principle with the phrase: pack once, run anywhere.

The end of “But it works on my machine”

In software development there is a famous phrase: “It works on my machine.” This refers to the moment when a program runs flawlessly for the developer but not on the server. The cause is almost always differences in the environment. A library exists in a different version, a setting is missing, the operating system is different. Containers eliminate these differences because the environment is included in the package.

The second reason is speed. Large providers often update their services multiple times a day. This is only possible if new versions can be tested and rolled out automatically. Containers are the standard packaging for this: you simply swap one package for a newer one. If something goes wrong, you roll back to the old package.

This also makes a difference financially. On a single server, dozens of containers can run side by side without interfering with each other. This allows data centers to utilize their machines much more efficiently. That is one reason why cloud providers – companies that rent out computing power by the hour – rely almost entirely on this technology.

What’s inside such a package

It all starts with a blueprint, usually a simple text file. It specifies which base system is used, which additional programs are installed, and how the program should be started. From this blueprint, a tool creates what is called an image, i.e. an immutable template. Starting the image creates a running container. From a single template, any number of identical containers can be started.

It’s important to understand the difference from the virtual machine, the older approach. A virtual machine emulates an entire computer and brings along its own complete operating system. It therefore quickly takes up several gigabytes and often needs about a minute to start. Containers, by contrast, share the operating system kernel with the host computer. That’s why they are often only a few hundred megabytes in size and ready to use in a fraction of a second.

A common misconception is that containers are completely isolated from one another. They are separated, but the separation is thinner than with a virtual machine. Those with especially high security requirements therefore combine both approaches. And because hundreds of containers run simultaneously in large systems, a conductor is needed: software like Kubernetes distributes containers across servers, restarts crashed ones, and adds more when load is high.

Containers behind the scenes of your apps

You almost never see containers directly, yet you use them constantly. When you stream a video, send a message, or place an online order, servers are running in the background whose programs are packaged in containers. The term that comes up most often in the news in this context is Docker – the best-known tool for building and starting containers.

In the world of AI, containers are especially important. A language model needs very specific computing libraries and drivers for the graphics cards it runs on. Setting up this combination by hand is tedious and error-prone. Ready-made containers take care of this. This also allows researchers to share their results in a reproducible way, because others can start up exactly the same environment.

Economically, this topic regularly appears in quarterly reports. Companies like Amazon, Microsoft, and Google earn billions by running containers for their customers. When a news report mentions “cloud-native,” it almost always refers to software that was built from containers from the very start. Incidentally, you can try this out on any ordinary laptop – the tools for it are free.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.