Skip to main content
Legia

Apps & Software

What is a Container?

Also called Docker container.

Short definition

A container is a way to package an application together with everything it needs, such as libraries and configuration, into a single bundle that runs exactly the same on a developer's laptop, a test server, or a production server.

How it works

Developers write a recipe, such as a Dockerfile, that specifies the base system, libraries, and steps to install the application. The recipe is built into an image, and the image is run as a container on any server with a container engine. Unlike a virtual machine, a container shares the server's operating system kernel, so it is lighter and starts faster.

The problem it solves

The classic complaint “it works on my machine” comes up because library versions or settings differ between environments. With containers, the package tested on the staging server is exactly the same package released to production. Several applications that need different versions can also run side by side on one server without interfering with each other.

Example in a company

A company runs an old internal application that needs an old version of PHP, and a new application that needs the latest version. Each runs in its own container on the same server. When the server is replaced, moving them is just a matter of running the same images on the new server.

What to watch out for: images need regular updates because the libraries inside can have security vulnerabilities, and important data is stored outside the container so it is not lost when the container is rebuilt. For many containers across many servers, companies usually use an orchestrator such as Kubernetes.

Related Legia service DevOps & CI/CD Automated release pipelines, consistent environments, and monitoring that your own team can run.

Resources