dockerd
目录
守护进程
Usage: dockerd [OPTIONS]
A self-sufficient runtime for containers.
Options:
--add-runtime runtime Register an additional OCI compatible runtime (default [])
--allow-nondistributable-artifacts list Allow push of nondistributable artifacts to registry
--api-cors-header string Set CORS headers in the Engine API
--authorization-plugin list Authorization plugins to load
--bip string Specify network bridge IP
-b, --bridge string Attach containers to a network bridge
--cdi-spec-dir list CDI specification directories to use
--cgroup-parent string Set parent cgroup for all containers
--config-file string Daemon configuration file (default "/etc/docker/daemon.json")
--containerd string containerd grpc address
--containerd-namespace string Containerd namespace to use (default "moby")
--containerd-plugins-namespace string Containerd namespace to use for plugins (default "plugins.moby")
--cpu-rt-period int Limit the CPU real-time period in microseconds for the
parent cgroup for all containers (not supported with cgroups v2)
--cpu-rt-runtime int Limit the CPU real-time runtime in microseconds for the
parent cgroup for all containers (not supported with cgroups v2)
--cri-containerd start containerd with cri
--data-root string Root directory of persistent Docker state (default "/var/lib/docker")
-D, --debug Enable debug mode
--default-address-pool pool-options Default address pools for node specific local networks
--default-cgroupns-mode string Default mode for containers cgroup namespace ("host" | "private") (default "private")
--default-gateway ip Container default gateway IPv4 address
--default-gateway-v6 ip Container default gateway IPv6 address
--default-ipc-mode string Default mode for containers ipc ("shareable" | "private") (default "private")
--default-network-opt mapmap Default network options (default map[])
--default-runtime string Default OCI runtime for containers (default "runc")
--default-shm-size bytes Default shm size for containers (default 64MiB)
--default-ulimit ulimit Default ulimits for containers (default [])
--dns list DNS server to use
--dns-opt list DNS options to use
--dns-search list DNS search domains to use
--exec-opt list Runtime execution options
--exec-root string Root directory for execution state files (default "/var/run/docker")
--experimental Enable experimental features
--feature map Enable feature in the daemon
--fixed-cidr string IPv4 subnet for fixed IPs
--fixed-cidr-v6 string IPv6 subnet for fixed IPs
-G, --group string Group for the unix socket (default "docker")
--help Print usage
-H, --host list Daemon socket(s) to connect to
--host-gateway-ip ip IP address that the special 'host-gateway' string in --add-host resolves to.
Defaults to the IP address of the default bridge
--http-proxy string HTTP proxy URL to use for outgoing traffic
--https-proxy string HTTPS proxy URL to use for outgoing traffic
--icc Enable inter-container communication (default true)
--init Run an init in the container to forward signals and reap processes
--init-path string Path to the docker-init binary
--insecure-registry list Enable insecure registry communication
--ip ip Default IP when binding container ports (default 0.0.0.0)
--ip-forward Enable net.ipv4.ip_forward (default true)
--ip-masq Enable IP masquerading (default true)
--ip6tables Enable addition of ip6tables rules (experimental)
--iptables Enable addition of iptables rules (default true)
--ipv6 Enable IPv6 networking
--label list Set key=value labels to the daemon
--live-restore Enable live restore of docker when containers are still running
--log-driver string Default driver for container logs (default "json-file")
--log-format string Set the logging format ("text"|"json") (default "text")
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
--log-opt map Default log driver options for containers (default map[])
--max-concurrent-downloads int Set the max concurrent downloads (default 3)
--max-concurrent-uploads int Set the max concurrent uploads (default 5)
--max-download-attempts int Set the max download attempts for each pull (default 5)
--metrics-addr string Set default address and port to serve the metrics api on
--mtu int Set the containers network MTU (default 1500)
--network-control-plane-mtu int Network Control plane MTU (default 1500)
--no-new-privileges Set no-new-privileges by default for new containers
--no-proxy string Comma-separated list of hosts or IP addresses for which the proxy is skipped
--node-generic-resource list Advertise user-defined resource
--oom-score-adjust int Set the oom_score_adj for the daemon
-p, --pidfile string Path to use for daemon PID file (default "/var/run/docker.pid")
--raw-logs Full timestamps without ANSI coloring
--registry-mirror list Preferred registry mirror
--rootless Enable rootless mode; typically used with RootlessKit
--seccomp-profile string Path to seccomp profile. Use "unconfined" to disable the default seccomp profile (default "builtin")
--selinux-enabled Enable selinux support
--shutdown-timeout int Set the default shutdown timeout (default 15)
-s, --storage-driver string Storage driver to use
--storage-opt list Storage driver options
--swarm-default-advertise-addr string Set default address or interface for swarm advertised address
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default "~/.docker/ca.pem")
--tlscert string Path to TLS certificate file (default "~/.docker/cert.pem")
--tlskey string Path to TLS key file (default "~/.docker/key.pem")
--tlsverify Use TLS and verify the remote
--userland-proxy Use userland proxy for loopback traffic (default true)
--userland-proxy-path string Path to the userland proxy binary
--userns-remap string User/Group setting for user namespaces
--validate Validate daemon configuration and exit
-v, --version Print version information and quit
带 [] 的选项可以多次指定。
描述
dockerd
是管理容器的持久进程。Docker 对守护进程和客户端使用不同的二进制文件。要运行守护进程,请键入 dockerd
。
要使用调试输出运行守护进程,请使用 dockerd --debug
或将 "debug": true
添加到 daemon.json
文件。
注意
启用实验性功能
使用
--experimental
标志启动dockerd
或将"experimental": true
添加到daemon.json
文件中,以启用实验性功能。
环境变量
dockerd
守护进程支持以下环境变量列表。Docker 守护进程和 docker
CLI 都支持其中一些环境变量。请参考 环境变量了解 docker
CLI 支持的环境变量。
变量 | 描述 |
---|---|
DOCKER_CERT_PATH | 身份验证密钥的位置。此变量由 docker CLI和 dockerd 守护进程使用。 |
DOCKER_DRIVER | 要使用的存储驱动程序。 |
DOCKER_RAMDISK | 如果设置此项,则禁用 pivot_root 。 |
DOCKER_TLS_VERIFY | 设置后,Docker 使用 TLS 并验证远程端。此变量由 docker CLI和 dockerd 守护进程使用。 |
DOCKER_TMPDIR | 守护进程创建的临时文件的位置。 |
HTTP_PROXY | HTTP 请求的代理 URL,除非被 NoProxy 覆盖。详情请参见 Go 规范。 |
HTTPS_PROXY | HTTPS 请求的代理 URL,除非被 NoProxy 覆盖。详情请参见 Go 规范。 |
MOBY_DISABLE_PIGZ | 禁用使用 unpigz 以并行方式解压缩层(即使已安装)。 |
NO_PROXY | 逗号分隔的值,指定应从代理中排除的主机。详情请参见 Go 规范。 |
示例
代理配置
注意
请参考 Docker Desktop 手册如果您正在运行 Docker Desktop。
如果您位于 HTTP 代理服务器之后(例如在公司环境中),则可能必须配置 Docker 守护进程以使用代理服务器执行拉取和推送镜像等操作。守护进程可以通过三种方式进行配置
- 使用环境变量 (
HTTP_PROXY
、HTTPS_PROXY
和NO_PROXY
)。 - 在 守护进程配置文件 中使用
http-proxy
、https-proxy
和no-proxy
字段(Docker Engine 23.0 或更高版本)。 - 使用
--http-proxy
、--https-proxy
和--no-proxy
命令行选项。(Docker Engine 23.0 或更高版本)。
命令行和配置文件选项优先于环境变量。请参考 使用 systemd 控制和配置 Docker