首先备份docker文件:
cp /usr/lib/systemd/system/docker.service /usr/lib/systemd/system/docker.service_back
编辑docker文件:/usr/lib/systemd/system/docker.service
vim /usr/lib/systemd/system/docker.service
修改ExecStart行为下面内容
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
重新加载docker配置
systemctl daemon-reload // 1,加载docker守护线程
systemctl restart docker // 2,重启docker
-
systemctl daemon-reload
-
systemctl restart docker