1、查看/usr/lib/systemd/system/docker.service配置
cat /usr/lib/systemd/system/docker.service
2、将/usr/lib/systemd/system/docker.service配置中[Service]下ExecStart修改成
[Service]
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
3、重新加载&重启
systemctl daemon-reload && systemctl restart docker
遇到问题:如果启动时有如下错误
Job for docker.service failed because the control process exited with error code.See "systemctl status docker.service" and "journalctl -xe" for details.
解决办法:
# 进入docker目录
cd /etc/docker/
# 修改daemon的类型
mv daemon.json daemon.conf
# 重启docker
systemctl restart docker