mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 12:21:17 +00:00
Fix heading hierarchy
This commit is contained in:
@@ -1,3 +1,50 @@
|
||||
## 12.5 容器格式
|
||||
|
||||
最初,Docker 采用了 `LXC` 中的容器格式。从 0.7 版本以后开始去除 LXC,转而使用自行开发的 [libcontainer](https://github.com/docker/libcontainer),从 1.11 开始,则进一步演进为使用 [runC](https://github.com/opencontainers/runc) 和 [containerd](https://github.com/containerd/containerd)。
|
||||
### Docker 容器格式的演进
|
||||
|
||||
最初,Docker 采用了 `LXC` 中的容器格式。从 0.7 版本以后开始去除 LXC 的依赖,转而使用自行开发的 [libcontainer](https://github.com/docker/libcontainer)。从 1.11 开始,则进一步演进为使用 [runC](https://github.com/opencontainers/runc) 和 [containerd](https://github.com/containerd/containerd)。
|
||||
|
||||
### 关键组件说明
|
||||
|
||||
#### LXC(Linux 容器)
|
||||
|
||||
Docker 早期版本(0.1-0.7)直接使用 LXC 作为容器运行时,利用 Linux Namespaces 和 Cgroups 实现容器隔离。
|
||||
|
||||
#### libcontainer
|
||||
|
||||
- Docker 自行开发的容器库
|
||||
- 提供了容器的通用接口
|
||||
- 不依赖于特定的 Linux 容器实现
|
||||
- 更灵活和可控
|
||||
|
||||
#### runC
|
||||
|
||||
- OCI(Open Container Initiative)标准实现
|
||||
- 轻量级的容器运行时
|
||||
- 独立的二进制文件,可单独使用
|
||||
- 基于 libcontainer 发展而来
|
||||
|
||||
#### containerd
|
||||
|
||||
- Docker 开源的容器运行时
|
||||
- 提供了容器的完整生命周期管理
|
||||
- 支持 runC 和其他 OCI 兼容的运行时
|
||||
- 在 Kubernetes 等编排系统中广泛使用
|
||||
|
||||
### 容器规范标准
|
||||
|
||||
Docker 积极参与 Open Container Initiative (OCI) 的制定,推动了以下规范的发展:
|
||||
|
||||
- **Image Spec**:容器镜像格式规范
|
||||
- **Runtime Spec**:容器运行时接口规范
|
||||
- **Distribution Spec**:容器镜像分发规范
|
||||
|
||||
### 架构演变的优势
|
||||
|
||||
从 LXC → libcontainer → runC/containerd 的演变提供了以下优势:
|
||||
|
||||
1. 减少外部依赖
|
||||
2. 提高运行效率
|
||||
3. 遵循行业标准(OCI)
|
||||
4. 增强可移植性和互操作性
|
||||
5. 支持多种容器运行时选择
|
||||
|
||||
Reference in New Issue
Block a user