CentOS安装docker启动失败
条评论在自己的测试服务器装起了docker,安装成功,but,启动失败了,解决后,在此记录下~
安装环境
[root@fantasykai ~]# uname -r
3.10.0-514.26.2.el7.x86_64
[root@fantasykai ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.3.1611 (Core)
Release: 7.3.1611
Codename: Core
安装docker
yum -y install docker
启动docker
启动报错:
[root@fantasykai ~]# service docder start
Redirecting to /bin/systemctl start docder.service
Failed to start docder.service: Unit not found.
解决方式:
新建一个docker.socket 文件
vim /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=docker
[Install]
WantedBy=sockets.target
然后运行
systemctl daemon-reload
systemctl start docker.socket
systemctl start docker
OK,启动好了,可以在愉快的玩耍了~