要通过tcp套接字使用守护程序,
-Htcp://0.0.0.0:2375应将选项添加到命令中
docker(两者都用于
daemon和
run)。
要使用默认的unix套接字访问该守护程序,请确保Docker守护程序也使用该选项启动
-H=unix:///var/run/docker.sock。
请注意,
tcp如果您不信任所处的网络,则使用危险。这是手册页中的文档:
-H, --host=[unix:///var/run/docker.sock]: tcp://[host]:[port][path] to bind or unix://[/path/to/socket] to use. The socket(s) to bind to in daemon mode specified using one or more tcp://host:port/path, unix:///path/to/socket, fd://* or fd://socketfd. If the tcp port is not specified, then it will default to either 2375 when --tls is off, or 2376 when --tls is on, or --tlsverify is specified.



