从godaddy购买的服务器,CentOS7.9版本系统,安装docker成功,
》启动
sudo systemctl start docker
却报类似如下错误
[root@ip-120-65-109-232 test]# sudo systemctl start docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
》查看错误详情
systemctl status -l docker.service
打印信息如下
[root@ip-120-65-109-232 hinsir]# systemctl status -l docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/docker.service.d
└─godaddy.conf
Active: failed (Result: start-limit) since 五 2021-01-15 04:34:25 MST; 55s ago
Docs: https://docs.docker.com
Process: 24691 ExecStartPost=/opt/godaddy/docker/configure-snat (code=exited, status=2)
Process: 24560 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=0/SUCCESS)
Main PID: 24560 (code=exited, status=0/SUCCESS)1月 15 04:34:23 ip-120-65-109-232.ip.secureserver.net systemd[1]: Failed to start Docker Application Container Engine.
1月 15 04:34:23 ip-120-65-109-232.ip.secureserver.net systemd[1]: Unit docker.service entered failed state.
1月 15 04:34:23 ip-120-65-109-232.ip.secureserver.net systemd[1]: docker.service failed.
1月 15 04:34:25 ip-120-65-109-232.ip.secureserver.net systemd[1]: docker.service holdoff time over, scheduling restart.
1月 15 04:34:25 ip-120-65-109-232.ip.secureserver.net systemd[1]: Stopped Docker Application Container Engine.
1月 15 04:34:25 ip-120-65-109-232.ip.secureserver.net systemd[1]: start request repeated too quickly for docker.service
1月 15 04:34:25 ip-120-65-109-232.ip.secureserver.net systemd[1]: Failed to start Docker Application Container Engine.
1月 15 04:34:25 ip-120-65-109-232.ip.secureserver.net systemd[1]: Unit docker.service entered failed state.
1月 15 04:34:25 ip-120-65-109-232.ip.secureserver.net systemd[1]: docker.service failed.
很显眼发现错误行在Process: 24691 ExecStartPost=/opt/godaddy/docker/configure-snat (code=exited, status=2)
而且错误文件定位在/etc/systemd/system/docker.service.d/godaddy.conf,可以去到该文件,将“ExecStartPost=/opt/godaddy/docker/configure-snat”这行代码注释掉
然后执行
systemctl daemon-reload
至此Docker就可以正常启动了。