mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 04:14:38 +00:00
- Enforce Level 1-3 structural numbering based on SUMMARY.md hierarchy - Remove structural numbering from Level 4+ headings - Eliminate single child headings by converting to bold text - Auto-inject summary text for headings with multiple children missing intro text - Exclude Appendix chapters from structural numbering - Avoid modifying code block contents - Add script to detect non-standard English usage in headers
1.8 KiB
1.8 KiB
11.7 本章小结
相关信息如下表:
| Namespace | 隔离内容 | 一句话说明 |
|---|---|---|
| PID | 进程 ID | 容器有自己的进程树 |
| NET | 网络 | 容器有自己的 IP 和端口 |
| MNT | 文件系统 | 容器有自己的根目录 |
| UTS | 主机名 | 容器有自己的 hostname |
| IPC | 进程间通信 | 容器间 IPC 隔离 |
| USER | 用户 ID | 容器 root ≠ 宿主机 root |
11.7.1 延伸阅读
- 控制组 (Cgroups):资源限制机制
- 联合文件系统:分层存储的实现
- 安全:容器安全实践
- Linux Namespace 官方文档
| 资源 | 限制参数 | 示例 |
|---|---|---|
| 内存 | -m |
-m 512m |
| CPU 核心数 | --cpus |
--cpus=1.5 |
| CPU 绑定 | --cpuset-cpus |
--cpuset-cpus="0,1" |
| 磁盘 I/O | --device-write-bps |
--device-write-bps /dev/sda:10mb |
| 进程数 | --pids-limit |
--pids-limit=100 |
11.7.2 延伸阅读
- 命名空间:资源隔离
- 安全:容器安全概述
- Docker Stats:监控容器资源
| 概念 | 说明 |
|---|---|
| UnionFS | 将多层目录联合挂载为一个文件系统 |
| Copy-on-Write | 写时复制,修改时才复制到可写层 |
| overlay2 | Docker 默认推荐的存储驱动 |
| 分层好处 | 镜像复用、快速构建、快速启动 |