Full Byte Developer.

What is a container?

A container is an isolated process with its files; it shares the host kernel, unlike a VM.

Published here , updated · 8 sources

A container is an isolated process (or set of processes) packaged with the files it needs to run, so the same unit behaves consistently across machines. Docker Docs say containers are isolated processes for each of your app's components [1]. A container shares the host OS kernel; a VM ships a full guest OS with its own kernel [1][5].

Quick start: run a tiny welcome container

Docker Docs walk through short CLI demos. This host captured the official hello-world path with Docker Engine 29.1.3:

bash
docker run --rm hello-world

Captured output (trimmed to the teaching lines):

text
Hello from Docker!
This message shows that your installation appears to be working correctly.

Sandbox capture on the review host; re-run on your box before you treat the numbers as a lab result.

Per Docker's own message, the client talked to the daemon, the daemon pulled the image, created a container, ran it, and streamed the output back [1]. Treat printed container ids as disposable; refresh them on your own host.

Split image from container

A container image is the package. A container is a running (or stopped) instance of that package. Docker's product page: an image is a lightweight, standalone, executable package of software that includes everything needed to run an application (code, runtime, system tools, system libraries and settings), and images become containers at runtime on Docker Engine [5]. Docker Learn (checked 2026-12-03) treats an image as the layered package a container starts from, and contrasts containers with VMs that ship a guest kernel [1].

bash
docker image ls hello-world

Captured shape on this host:

text
IMAGE                ID             DISK USAGE   CONTENT SIZE   EXTRA
hello-world:latest   1e4c05b897a7       25.9kB         9.49kB

Listing shows the image on disk; it does not start a new process until you docker run [2].

Watch the host still see a process

Containers are not a second kernel. They wrap processes with namespaces and cgroups [3][4]. On this host, a short-lived Alpine sleep container still appeared in the host process table:

bash
docker run --rm -d --name fbd-demo alpine:3.20 sleep 5
docker inspect -f 'Pid={{.State.Pid}}' fbd-demo
ps -o pid,comm -p "$(docker inspect -f '{{.State.Pid}}' fbd-demo)"

Captured shape:

text
Pid=48464
    PID COMMAND
  48464 sleep

The host kernel scheduled that sleep. Namespaces gave it a different mount, PID, and network view (mnt, pid, and net links under /proc/<pid>/ns/ pointed at distinct inode numbers). That is isolation, not a guest OS [1][3][8].

VM vs container Virtual machine app guest OS + guest kernel hypervisor host hardware own kernel copy [1] Containers app A app B isolated processes + files shared host kernel host hardware namespaces + cgroups [3][4]

A virtual machine ships a guest OS and its own kernel above a hypervisor. Containers run as isolated processes with their files, sharing one host kernel through namespaces and cgroups instead of a second kernel copy.

Contrast containers with VMs

A VM runs a guest OS with its own kernel. Containers share the host kernel as isolated processes. Docker Docs: a VM is an entire operating system with its own kernel, hardware drivers, programs, and applications; a container is an isolated process with the files it needs; multiple containers share the same kernel [1]. Docker's product page frames the same split: containers abstract at the app layer and run as isolated processes in user space; VMs abstract physical hardware and each includes a full OS copy [5]. Cloud VMs often host a container runtime, so the two models sit together in practice [1].

Kubernetes calls a container image a ready-to-run package with code, runtime, libraries, and default settings, and notes that the word container is overloaded [7]. Red Hat: a Linux container is a set of one or more processes isolated from the rest of the system, with files from a distinct image, portable across environments that share the same OS kernel [8].

Keep the shipping analogy inside its limits

The OCI Runtime Spec principles use a real shipping-container analogy: physical shipping containers are a fundamental unit of delivery irrespective of contents, and Standard Containers aim to be the standardized unit of software delivery [6]. That teaches packaging and portability. It does not mean a separate computer, a sealed-from-host kernel, or finished hardening with no further work.

On docker run, Docker creates namespaces and control groups. Namespaces give each container its isolated workspace; cgroups account for and limit CPU, memory, and disk I/O [3][4]. Isolation helps; it is not a substitute for hardening, trusted images, and least privilege [4].

Mistakes that confuse the glossary

Calling a container a tiny VM with its own kernel [1][5].

Mixing image and container when debugging: deleting a stopped container does not delete the image layers you still need [2][3].

Treating namespaces as finished security work. Engine security docs still require trusted images and least privilege [4].

Forgetting the host still sees a PID. Pair with what is a process when someone says the container is "not a process."

Shipping privileged containers as the default because "it works on my laptop." Rootless and least privilege exist for a reason [4].

Depth: where this page sits in the Docker series

History and the 2013 packaging problem live in why Docker was introduced. Images, layers, and the runtime walkthrough continue in how Docker works. Orchestration choices show up later in Docker Swarm vs Kubernetes. When the runtime sits on a rented box, pair this glossary with what is the cloud.

Refuse the tiny-VM shortcut in design review: the host still schedules the container PID on a shared kernel.

Image layers without the mysticism

Image-versus-writable-layer detail belongs on how Docker works. For this glossary: image equals package; container equals a runnable or stopped instance of that package [1][5].

Isolation is not a second computer

Namespaces rewrite what a process can see: process ids, mounts, network interfaces, and more [3][8]. Cgroups limit how much CPU and memory that process may consume [3][4]. Neither feature invents a guest kernel. If you need a different kernel, you need a VM or a different host. If you need a repeatable app filesystem plus isolation on one kernel, a container fits.

The host-PID demo earlier is the proof you keep: ps on the host still lists the container's process under the Engine's runtime tree. That single observation beats the tiny-VM metaphor in design review, because a guest kernel would hide that PID behind a hypervisor boundary [1][3][5]. Pair the glossary with what is a process when someone argues the container is "not really a process."

Rootless mode and user namespaces shrink the privilege story, but they do not remove the need to trust the image and drop capabilities you do not need [4]. Treat "it runs in Docker" as a packaging claim, not a security certificate.

Browse the Dev explainers topic.

Send this to the friend who thinks a container is just a small virtual machine.

A slim isolated process capsule with its own teal filesystem layer stack standing on a shared dark host-kernel plane, beside a larger boxed virtual machine that sits on its own separate kernel slab, rendered as clean geometric solids with no logos or typography.
A container is an isolated process with its files. It still shares the host kernel.

Keep this guide

By Full Byte Developer

Filed under Dev explainers

Questions about this guide

Is a container a tiny virtual machine?

No. Docker Docs describe a VM as an entire OS with its own kernel, and a container as an isolated process with the files it needs. Multiple containers share the host kernel.

What is the difference between an image and a container?

An image is the immutable package of files, binaries, libraries, and configurations. A container is a runnable instance of that image.

Do containers finish the hardening job for you?

No. Isolation uses kernel namespaces and cgroups, and the daemon often needs root unless you use rootless mode. Hardening, trusted images, and least privilege are still required.

Sources

Next in this stack