当前环境:centos7
1.参考docker官方文档安装docker:https://docs.docker.com/engine/installation/linux/centos/
[root@catchtouch ~]# yum update #更新yum源
[root@catchtouch ~]# tee /etc/yum.repos.d/docker.repo <<-\'EOF\'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
#添加yum源
[root@catchtouch ~]# yum install docker-engine #安装docker
[root@catchtouch ~]# systemctl enable docker.service #设置docker服务开机自动启动
[root@catchtouch ~]# systemctl start docker #启动docker
#以上内容摘抄自docker官方文档