1) 卸载旧版本docker
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine
2) 下载docker-ce的repo
curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
3) 安装docker依赖
yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
4) 安装docker-ce
yum install docker-ce
5) 启动docker并添加自启动
systemctl start dockersystemctl enable docker
7) 查看版本信息
docker version
8) 拉取镜像,可以去镜像仓库找一个存在的镜像测试,这里是有hello-world
sudo docker pull hello-world
常用镜像地址:
网易:https://c.163yun.com
阿里云:https://cr.console.aliyun.com/
Docker Hub: https://hub.docker.com/
客户端和服务端版本信息
9) 运行镜像
sudo docker pull hello-world