说明:
1、安装部署docker完成后,启动docker报错:Failed to listen on Docker Socket for the API,如下图所示:
2、将SocketGroup=docker更改成:SocketGroup=root即可
一、解决方法:
1、执行命令:
find / -name docker.socket
cat /usr/lib/systemd/system/docker.socket
vim /usr/lib/systemd/system/docker.socket
[root@localhost ~]# cat /usr/lib/systemd/system/docker.socket
[Unit]
Description=Docker Socket for the API
PartOf=docker.service[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=root[Install]
WantedBy=sockets.target
二、启动docker服务
systemctl daemon-reload
systemctl start docker
systemctl status docker