第一步链接linux
第二步查看系统版本
uname -r
[root@VM-12-2-centos lighthouse]# uname -r
uname -a
[root@VM-12-2-centos lighthouse]# uname -a
第三步更新yum包
yum update
[root@VM-12-2-centos lighthouse]# yum update
第四步设置yum源(阿里仓库)
[root@VM-12-2-centos lighthouse]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
查看可安装的docker版本
[root@VM-12-2-centos lighthouse]# yum list docker-ce --showduplicates | sort -r、
安装指定版本docker
这里可以按照自己的需求来选择
yum install
[root@VM-12-2-centos lighthouse]# yum install docker-ce-18.03.1.ce
启动docker
systemctl start docker
[root@VM-12-2-centos lighthouse]# systemctl start docker
设置开机启用
systemctl enable docker
[root@VM-12-2-centos lighthouse]# systemctl enable docker
查看docker版本
docker version
[root@VM-12-2-centos lighthouse]# docker version