Docker and the container principle

Tech and Architecture
Vignette docker et le principe de container

Docker, or the tool that made the use of containers mainstream — we have all heard of it, but what exactly is it?

What is a container?

In order to understand what the Docker tool is, you first need to know what a container is. Picture a kind of “box” in which you can install a whole working environment such as applications and their libraries. It is in fact a virtualisation technique, however this one is clearly different from the technique used for virtual machines (VMs). Indeed, a virtual machine, as its name suggests, is neither more nor less than a machine without hardware of its own (the physical components of a computer). The VM can include an OS (operating system), with all its system administration (management of ports, peripherals, etc.), a visual interface, as well as its installed applications.

Container versus VM: a question of resources

Right, so if the container is a box and it allows you to use the same applications as a virtual machine, why bother? The big battle is fought over resource management: the VM is greedier! And this is where the container’s role comes in. This simple “execution box” works with the host OS (Linux most of the time)! It is therefore:

  • lighter
  • faster to download, install, back up, restore or even migrate
  • easier to share

Deployment made easier by its portability

As a result, the tool offers far greater ease of deployment. That’s right — the container is independent of other infrastructure, which means it can be moved anywhere without causing compatibility problems. It can be shared between all developers, and therefore guarantee a common development environment, extremely close to the production one, while making it easier to set up. It is then possible to migrate an application smoothly from the development environment through to the production environment. Deployments are also accelerated and made easier thanks to certain companion tools. The icing on the cake: system administrators no longer need to manage software versions across all their servers.

Docker lets you manipulate containers

First of all, you should know that Docker comes with several tools. Today we are going to focus primarily on Docker Engine, Docker’s container runtime. To create a Docker container you necessarily have to base it on an image. The image contains all the elements needed to make your container work. If you want to create a MySQL 5.7 container, you will have to base it on a MySQL 5.7 image. Images are available on the official image registry called Docker Hub. It works in the same way as apt-get, npm, yarn or composer. There is an endless supply of them for all kinds of software (ubuntu, apache, nginx, php, node, ruby, python, java, mysql, postgres, mongo, wordpress, prestashop, magento, etc.). Note that you also have the option of creating your own images, based or not on existing images, thanks to Dockerfiles.

Creating a Docker container

$ docker run mysql:5.7
Your container will have its own life cycle: you will be able to stop it and restart it while keeping the data resulting from your operations. By default, the data is kept inside the container and is not accessible from your own machine. If you delete your container, you will lose your data unless you use volumes. Volumes are folders shared between the container and the host (your computer, for example). They bring persistence to the container’s data. In the case of the MySQL 5.7 container, we choose to share the folder “/var/lib/mysql”. That way we keep the files of the various databases created in the container. MySQL configuration parameters can be passed to the container through environment variables when Docker is launched. You can, for example, define a specific root password thanks to the -e parameter in the following command line:
$ docker run --name mysql-numendo -e MYSQL_ROOT_PASSWORD=numendopassword -d mysql:5.7

Defining a volume

To define a volume, you use the -v parameter:
$ docker run --name mysql-numendo -v /projets/numendo/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=numendopassword -d mysql:5.7
Here, the directory on our computer (the host’s) located in /projets/numendo/mysql is shared with the /var/lib/mysql directory located in the container we have just created. That way, all the changes made by the container to the files in this volume are reflected in our folder located on our computer, and vice versa. This brings persistence to your containers’ data even if the containers are deleted. This data can be shared with a third party, which will allow them to create a container identical to yours from the same image (mysql:5.7), which will be retrieved via Docker Hub.
By way of examples, we have had the opportunity to use Docker in the context of continuous integration and deployment; for a local LAMP WordPress server; for a GitLab server, as well as an OpenStreetMap server. And what about you — have you already used Docker, and if so what for?
These explanations only cover the visible part of the iceberg, or should we say, of the cargo ship… In a future article, we will look at the administration and orchestration of Docker containers. If you enjoyed this article, do take a look at our blog! We love discovering new web technologies, but even more than that, sharing them with you!

How about we connect?

Shape your brand’s digital future. Whether you want to align your touchpoints, create unified customer experiences, or optimize your omnichannel ecosystem, we design solutions that blend innovation and elegance.

Parler à un expert

Insights,
the essentials

All news
Replatforming E-commerce pourquoi et comment migrer de Salesforce Commerce Cloud (SFCC) vers Shopify Plus
Tech and Architecture 19.08.2026

E-commerce Replatforming: Why and How to Migrate from Salesforce Commerce Cloud (SFCC) to Shopify Plus?

Certification_Microsoft_Azur Numendo
Tech and Architecture 15.04.2025

Why the Microsoft AZ-900 Certification is an excellent starting point for building Azure Skills

Mehdi developpeur fullstack senior
Tech and Architecture 02.05.2024

Mehdi, Senior Full-Stack Developer at Numendo: “I was on a conventional path that I ended up not following”

Image représentant l'article CI / CD
Tech and Architecture 04.05.2021

Delivering efficiently thanks to the CI/CD approach

Numendo Paris Agency

48 Rue de la Bienfaisance
75008 Paris

Our Paris agency supports brands and key accounts with their most strategic digital projects.

Located just 10 minutes from Saint-Lazare station and steps from the Miromesnil metro, it brings together our experts in consulting, e-commerce, product data, and omnichannel architecture.

Numendo Paris embodies the perfect synergy of strategic vision, technical expertise, and client proximity.

Be part of the adventure
Numendo Paris

Joining Numendo Paris means joining an innovation hub where technical excellence meets an entrepreneurial spirit. A stimulating environment to drive world-class strategic projects right in the heart of the capital.

Numendo Mulhouse Agency

2a Av. Auguste Wicky
68100 Mulhouse

The Mulhouse agency is our technical center of excellence dedicated to the performance of your business platforms.

Located in the heart of Alsace, steps from the Mulhouse train station and in close proximity to Germany and Switzerland, our office is home to a community of passionate experts focused on innovation and code robustness.

It embodies the group’s technological powerhouse, capable of building highly complex B2B and industrial ecosystems.

Be part of the adventure
Numendo Mulhouse

Thriving in Mulhouse means joining a historic hub where a passion for technology and team spirit take center stage. <br>A human-scale environment ideal for tackling large-scale industrial and technical challenges.

Numendo Genève Agency

Rue du Marché 5,
1204 Genève

Our Geneva agency combines a culture of precision with digital expertise to elevate your projects in Switzerland and internationally.

Ideally located in the very heart of Geneva, it offers a premium work environment to support the data transformation of the most demanding businesses.

Geneva is our dedicated hub for structuring product information and deploying agile and scalable e-commerce strategies, primarily within the luxury and finance sectors.

Be part of the adventure
Numendo Geneva

Being part of the Geneva team means cultivating high standards and precision to deliver high-performing, sustainable digital solutions.<br>An exceptional work environment to transform the future of product data and Swiss e-commerce.