https://docs.docker.com/engine/install/
- 配置开启ip、端口
sudo vim /usr/lib/systemd/system/docker.service
# 在Service资源块的ExecStart末端加入 -H tcp://0.0.0.0:2375
...
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
...
- 重启生效
systemctl daemon-reload
systemctl restart docker
- 防火墙开端口(如果开启了防火墙)
firewall-cmd --zone=public --add-port=2375/tcp --permanent
- 检查是否可用
telnet 127.0.0.1 2375