第一步:卸载旧版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
使用xshell连接远程服务器,出现下列提示即为卸载成功。
2、需要的安装包
yum install -y yum-utils
3、设置镜像的仓库
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo 默认是国外的
国内的阿里云,推荐使用,速度快
yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4、更新软件包索引
yum makecache fast
5、安装docker相关的引擎 docker-ce社区版
yum install docker-ce-cli containerd.io
6、启动docker
systemctl start docker
docker version 出现下列提示即为启动成功。
7、使用hello world验证
docker run hello-world
8、查看下载的hello-world镜像是否存在
docker images
9、卸载docker