安装Docker后,启动失败,报错如下:

[root@st01015vm192 ~]# sudo service docker start
Redirecting to /bin/systemctl start docker.service
A dependency job for docker.service failed. See 'journalctl -xe' for details.
[root@st01015vm192 ~]# sudo service docker status
Redirecting to /bin/systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com

Apr 21 14:21:28 st01015vm192 systemd[1]: Dependency failed for Docker Application Container Engine.
Apr 21 14:21:28 st01015vm192 systemd[1]: Job docker.service/start failed with result 'dependency'.
Apr 21 14:22:00 st01015vm192 systemd[1]: Dependency failed for Docker Application Container Engine.
Apr 21 14:22:00 st01015vm192 systemd[1]: Job docker.service/start failed with result 'dependency'.

先排除防火墙与SELinux已关闭

[root@st01015vm192 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)
[root@st01015vm192 ~]# sestatus  
SELinux status:                 disabled

给 系统添加一个docker组

[root@st01015vm192 ~]#  groupadd docker
groupadd: cannot open /etc/group

做过基线配置 没有权限 使用 chattr -i 增加一下权限

[root@st01015vm192 ~]# chattr -i /etc/group
[root@st01015vm192 ~]#  groupadd docker
[root@st01015vm192 ~]# systemctl enable docker  && systemctl start docker

参考资料
https://www.jianshu.com/p/38831a8a47cb

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐