> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What are Containers

> Lightweight isolated user-space environments packaging applications and dependencies, sharing the host kernel using namespaces and cgroups for efficient, fast, and portable deployment compared with virtual machines.

Containers are lightweight, isolated user-space environments that package an application and its dependencies together while sharing the host operating system kernel. They give each container its own:

* Process tree (via PID namespaces)
* Network stack (via network namespaces)
* Filesystem mounts (via mount namespaces)
* Resource controls (via cgroups)

Because containers share the host kernel rather than a full guest OS, they are far more resource-efficient and faster to start than traditional virtual machines, while still providing strong isolation for processes and services.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/MdCtePW9RZ5CEjCp/images/Crash-Course-Docker-For-Absolute-Beginners/Docker-Basics/What-are-Containers/container-cards-os-kernel-slide-kodekloud.jpg?fit=max&auto=format&n=MdCtePW9RZ5CEjCp&q=85&s=bf6611a12ef41c57a3917524aefc71b1" alt="A presentation slide titled &#x22;What Is A Container?&#x22; showing four illustrated container cards labeled with &#x22;Processes&#x22;, &#x22;Network&#x22;, and &#x22;Mounts&#x22; above an &#x22;OS Kernel&#x22; bar. A presenter wearing a KodeKloud T-shirt appears at the right side of the image." width="1920" height="1080" data-path="images/Crash-Course-Docker-For-Absolute-Beginners/Docker-Basics/What-are-Containers/container-cards-os-kernel-slide-kodekloud.jpg" />
</Frame>

Historical context and runtimes

Container technology is not new. Linux container primitives and projects have been around for many years, including LXC, LXD, and LXCFS. Docker popularized containers for developers by building a higher-level toolset around these primitives, making it easy to build, distribute, and run container images.

* Early Docker used LXC under the hood.
* Around Docker v0.9.0 (circa 2014), Docker introduced `libcontainer` and later the `runc` project, which became the reference implementation of the OCI runtime.
* Modern Docker typically uses `containerd` + `runc` for the low-level container runtime stack.

<Callout icon="lightbulb" color="#1CB2FE">
  OCI stands for the [Open Container Initiative](https://opencontainers.org/). It defines open standards for container runtimes and image formats so different tools can interoperate.
</Callout>

Quick comparison: containers vs virtual machines

| Aspect | Containers | Virtual Machines |
| - | - | - |
| Kernel | Share host kernel | Each VM runs its own guest kernel |
| Isolation | Namespaces + cgroups | Hardware and hypervisor isolation |
| Startup time | Milliseconds to seconds | Seconds to minutes |
| Resource overhead | Low | Higher (full OS per VM) |
| Typical use case | Microservices, CI/CD, dev environments | Full OS isolation, legacy apps |

Common container-related projects and roles

| Project / Component | Role / Use Case |
| - | - |
| LXC / LXD / LXCFS | Early Linux container projects providing namespace and container tooling |
| Docker | Developer-friendly CLI and tooling for building/distributing container images |
| containerd | Dedicated container runtime daemon used by Docker and Kubernetes |
| runc | OCI-compliant low-level runtime that creates and runs containers |
| OCI | Standards body for container image and runtime specifications |

Why use Docker (and similar higher-level tools)?

Directly configuring kernel primitives (namespaces, cgroups, mounts) is possible but complex and error-prone. Docker and comparable tools wrap those low-level operations with:

* Declarative image formats (Dockerfiles / OCI images)
* Image registries for distribution
* Simple CLI and APIs for running and managing containers
* Integration with orchestration platforms like Kubernetes

References and further reading

* [Open Container Initiative (OCI)](https://opencontainers.org/)
* [Docker documentation](https://docs.docker.com/)
* [containerd](https://containerd.io/)
* [runc (GitHub)](https://github.com/opencontainers/runc)
* [Kubernetes Concepts](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/crash-course-docker-for-absolute-beginner/module/f4c089c7-24c8-488f-bb50-bbf844810374/lesson/fd76f15a-cca2-410e-85be-87efad3ed02d" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.