Files
docker_practice/16_appendix/command/dockerd.md
2026-02-21 10:19:28 -08:00

41 lines
1.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 服务端命令dockerd
### 使用说明
`dockerd` 参数会随版本变化建议优先在目标机器上执行 `dockerd --help`并以 `daemon.json` 为主进行持久化配置
### 常用选项Docker Engine 29.x
* `--config-file="/etc/docker/daemon.json"`指定 daemon 配置文件路径
* `--data-root=""`Docker 数据目录默认 `/var/lib/docker`
* `-H, --host=[]`指定 daemon 监听地址Unix socket / TCP
* `-D, --debug`开启调试日志
* `-l, --log-level="debug|info|warn|error|fatal"`日志级别
* `--group=""`Unix socket 所属用户组默认 `docker`
* `--containerd=""`指定 containerd socket
* `--exec-opt=[]`运行时执行选项 cgroup 驱动
* `--default-ulimit=[]`设置容器默认 ulimit
* `--dns=[]` / `--dns-search=[]` / `--dns-opt=[]`DNS 配置
* `--registry-mirror=[]`镜像加速地址
* `--insecure-registry=[]`允许访问不安全仓库
* `--iptables=true|false` / `--ip-forward=true|false` / `--ip-masq=true|false`网络转发与 NAT 规则控制
* `--ipv6=true|false`启用 IPv6
* `--storage-driver=""` / `--storage-opt=[]`存储驱动及参数
* `--log-driver=""` / `--log-opt=[]`容器日志驱动与参数
* `--authorization-plugin=[]`鉴权插件
* `--selinux-enabled=true|false`启用 SELinux 集成依赖发行版策略
* `--userns-remap=...`用户命名空间映射
* `--tls` / `--tlscacert` / `--tlscert` / `--tlskey` / `--tlsverify`TLS 安全配置
### 历史参数提示
以下参数已移除或不建议继续使用
* `--graph`请改用 `--data-root`
* `--cluster-store` / `--cluster-advertise` / `--cluster-store-opt`已移除
* `--disable-legacy-registry`已移除
### 参考
* [官方文档](https://docs.docker.com/reference/cli/dockerd/)