mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-11 00:47:38 +00:00
fix(content): correct verified technical facts across cgroups, namespaces, etcd and k8s sections
- 12.3: daemon.json has no top-level cgroup-driver key; use exec-opts native.cgroupdriver (values cgroupfs/systemd) per official dockerd reference - 12.2: USER namespace is not enabled by default; requires userns-remap (aligns with 18.1) - 14.1: cgroup v1 deprecation and kubelet default-fail happen in v1.35, not v1.36 (per kubernetes.io cgroups doc) - 15_etcd: maintenance window updated after etcd v3.7.0 release (2026-07-08) to 3.6/3.7 - 3.9.6: fix dangling sentence order in registry migration note - tools: add 'from __future__ import annotations' so PEP 604 annotations run on Python 3.9 (fixes npm test)
This commit is contained in:
@@ -198,14 +198,15 @@ $ docker run --rm --cpus=1 stress --cpu 4
|
||||
|
||||
#### Docker 对 cgroups v2 的支持
|
||||
|
||||
Docker 20.10+ 开始支持 cgroups v2(如果系统支持),提供更好的性能和资源隔离。如果需要明确控制或回退到 v1,可以通过 Docker 守护进程配置文件 `/etc/docker/daemon.json` 修改 `cgroup-driver` 参数:
|
||||
Docker 20.10+ 开始支持 cgroups v2(如果系统支持),提供更好的性能和资源隔离。cgroup 驱动可以通过 Docker 守护进程配置文件 `/etc/docker/daemon.json` 的 `exec-opts` 配置项指定:
|
||||
|
||||
```json
|
||||
{
|
||||
"cgroup-driver": "systemd"
|
||||
"exec-opts": ["native.cgroupdriver=systemd"]
|
||||
}
|
||||
```
|
||||
常见的 `cgroup-driver` 值包括 `systemd` (推荐) 和 `cgroupfs`。重启 Docker 守护进程后生效。
|
||||
|
||||
`native.cgroupdriver` 仅支持 `systemd` 和 `cgroupfs` 两个取值;若不指定,cgroup v1 主机默认使用 `cgroupfs`,带 systemd 的 cgroup v2 主机默认使用 `systemd`。重启 Docker 守护进程后生效。
|
||||
|
||||
#### 检查系统使用的版本
|
||||
|
||||
|
||||
Reference in New Issue
Block a user