How does Docker work? The process from image to container
Docker packages an application together with its code, libraries and runtime into a read-only image, and starts isolated containers from that image on the Linux kernel. This article explains step by step the components of this process, the difference from virtual machines, and the security layers.
Nurullah Okatan · Content Writer
· Updated: · 15 min read

According to AWS's definition of Docker, Docker packages an application together with its code, libraries, system tools and runtime into a standard unit called a container. Because this unit is built from a read-only image, it opens with the same content and in the same way on every server where Docker is installed.
The relationship between a Docker image and a container
According to AWS, a Docker image is a read-only template that defines a container. The image is a recipe, and a container is a running instance of that recipe. Any number of containers can be started from the same image, and all of them open with the same files.

What does an image contain?
An image carries everything the application needs to run: application code, the libraries it depends on, system tools and the runtime. AWS defines this package as a "standard unit". A Python version, a database driver or a configuration file is not expected from the server; it comes from inside the image.
Where are changes stored?
According to Blacksmith's article on Docker architecture, an image consists of stacked layers, and each layer is read-only. Changes a container makes while running are written to a new, writable layer on top. The image itself never changes. When the container is deleted, this writable layer is removed too; for data that must persist, a volume is defined.
The "it only works on my machine" problem
According to SentinelOne, Docker solves the well-known "it works only on my machine" problem. The reason is simple: the image the developer tests on a laptop and the image sent to the live server are the same file. Even if the library version on the server differs, the application uses the version in its own image. You can read how this approach is used in custom software projects in our articles on custom software development.
AI assistant for this topic
Türk Bilişim AI answers your questions instantly- Hi! Ask whatever you're curious about.
How Docker Client, Daemon and runc start a container
When you type docker run in the terminal, the Docker Client receives the command and forwards the request to the Docker Daemon. The Daemon then hands the work to runc through containerd. It is runc that actually starts the container.
Which component takes over when a command is written?
According to Blacksmith, Docker consists of three main components. The Docker Client is the basic interface through which the user talks to Docker, and it communicates with the Daemon to manage objects. The Daemon (dockerd) is a service that runs continuously in the background and exposes an API. The Client calls this API. Because of this separation, the Client can also connect to a Daemon on another machine.
When the Daemon receives the request, it first looks for the image. If the image is not available locally, it pulls it from a registry. It then prepares the network and storage settings and delegates the creation of the container to a lower layer.
What do containerd and runc do?
As Blacksmith reports, the default container runtime in Docker is runc. containerd, the intermediate layer that interfaces with the Daemon, works together with runc. containerd tracks the container lifecycle: starting, stopping and preparing image layers. runc makes the necessary calls to the Linux kernel, sets up isolation and launches the process.
| Component | Task | Communicates with |
|---|---|---|
| Docker Client | Receives the user's commands | Docker Daemon's API |
| Docker Daemon (dockerd) | Manages image, network and storage operations | Client and containerd |
| containerd | Carries out the container lifecycle | dockerd and runc |
| runc | Sets up isolation in the kernel and starts the process | Linux kernel |
Container vs. virtual machine
According to AWS's explanation, a virtual machine virtualizes server hardware, whereas a container virtualizes the server's operating system. A virtual machine boots a full operating system with its own kernel. A container, on the other hand, is an isolated process that uses the host machine's kernel.
Namespaces and cgroups
According to Wiz, Docker containers are native features of the Linux kernel. They achieve lightweight process isolation through namespaces and cgroups. Namespaces narrow the world the process sees: a container sees its own process list, network interfaces and file system, and does not see neighboring containers. cgroups determine how many resources the process may consume. Because no separate operating system is booted, a container takes up little space and starts quickly.
How are CPU and memory limited?
Wiz lists CPU and memory limits among Docker's built-in features. In practice, this limit is set when a container is started using the --cpus and --memory options. When the limit is exceeded, the kernel intervenes and prevents a single container from consuming the entire server.
| Feature | Virtual machine | Container |
|---|---|---|
| Virtualized layer | Hardware | Operating system |
| Kernel | Separate on each machine | Shared with the host |
| Isolation tool | Hypervisor | Namespaces and cgroups |
| Resource limit | Virtual hardware assigned to the machine | Per process via cgroups |
Setting up, monitoring and backing up the server that will run the containers is a separate task. Türk Bilişim, which describes itself as one of Turkey's best AI Chatbot & Customer Assistant firms and has operated as a digital agency since 1998, carries out this server-side work under Infrastructure & Support services, within Web Hosting & Server Management.
Isolation and security layers in Docker containers
The layers that protect a container work at the kernel level. AppArmor restricts the resources the process can access, and Seccomp filters the system calls it can make. Namespaces and cgroups provide the basic isolation beneath these.

AppArmor and Seccomp profiles
According to Sysdig's comparison of Docker security tools, Docker can automatically generate and load an AppArmor profile called docker-default for containers. This profile prevents the process inside the container from writing to sensitive file paths and from accessing certain kernel interfaces. According to the same source, Docker has used Seccomp since Docker Engine version 1.10. Profiles are written in a JSON-based language and compiled into seccomp filters. System calls the application never needs are blocked by this filter.
Sysdig notes that user namespaces and process isolation, together with cgroups and resource encapsulation, narrow the attack surface. A process running as root inside a container is mapped to an unprivileged user on the host when user namespaces are enabled.
The risk of sharing the kernel
According to SentinelOne, because containers share the kernel with the host system, a vulnerability in the host can also affect the containers. In a virtual machine, each machine has its own kernel, which divides this risk. Containers have no such boundary. For this reason, keeping the host's kernel up to date is as necessary as updating the software inside the container.
What does Docker Bench measure?
According to Sysdig, the Docker Bench tests are inspired by the CIS Docker Community Edition Benchmark v1.1.0. The tool scans the host configuration, Daemon settings, images and running containers against these criteria. Each check returns either a pass or a warning. Items that raise warnings also show containers that lack an AppArmor or Seccomp profile.
Docker's emergence in 2013 and its spread
According to Oracle, Linux containers had been in use since 2008. Their spread to a wide audience came in 2013 with the emergence of Docker containers. Docker was introduced by software engineer Solomon Hykes, who presented the concept at the PyCon 2013 conference. Oracle writes that Docker began that year as a nearly unknown, highly technical open-source project and over time became a standard working environment.
What changed was not the kernel technology. Docker packaged namespaces and cgroups settings in a portable image format and with short commands. According to AWS, Docker is installed on each server and provides simple commands to create, start or stop containers.
Use in microservices
According to SentinelOne, Docker makes it easier to develop and deploy microservices. Each service has its own image. When the payment service is updated, the user service is not reinstalled; only the payment image changes. To define multiple containers together, Docker Compose is used, and to deploy across many servers, orchestration tools such as Kubernetes are used.
Looking for Process Automation & AI Agents?Frequently asked questions
Are changes lost when a container is stopped?
No. The writable layer of a stopped container remains in place when it is restarted. Changes are lost when the container is deleted. Data that must persist even after deletion is kept on a volume.
Are Docker Engine and Docker the same thing?
Not exactly. According to Wiz, Docker containers run on Docker Engine, which operates on Linux containers. Docker Engine is the runtime engine that includes the Client and the Daemon, while "Docker" is the general name covering this engine along with the image format and tools.
Can a container be affected by a vulnerability in the host system?
Yes, it can. SentinelOne notes that because the kernel is shared, vulnerabilities on the host can be carried over to the containers. Not delaying kernel updates on the host reduces this risk.
What is Docker Bench used for?
It automatically audits a Docker installation against known security criteria. According to Sysdig, its tests are inspired by CIS's Docker benchmark. The warnings in the report show, item by item, which setting needs to be corrected.
Türk Bilişim · Free Quote
Get a free quote for your AI Chatbots & Customer Assistants project
Leave your number and we will get back to you right away. The call is free.
Your request is saved on this device
We can't reach our server right now. Your request will be sent automatically once the connection is back. To talk right away:

Share this article
Comments
Comments
No comments yet.
















