需要让docker启动时在tcp端口2375上监听api服务
vi /etc/systemd/system/docker-tcp.socket
[Unit]Description=Docker Socket for the API
[Socket]ListenStream=2375BindIPv6Only=both
Service=docker.service
[Install]WantedBy=sockets.target
然后再重启docker服务
systemctl enable docker-tcp.socket
systemctl stop docker
systemctl start docker-tcp.socket
systemctl start docker
systemctl daemon-reload