安装环境 CentOS 3.10.0-957.el7.x86_64
使用[root@localhost xxxxxx]# uname -r 查看一下你的CentOS的版本号
移除旧版本
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
安装必要的系统工具:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
添加软件源信息:
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
/var/run/yum.pid 已被锁定,PID 为 21427 的另一个程序正在运行。
Another app is currently holding the yum lock; waiting for it to exit...
执行过程中如果有这种提示信息
执行sudo kill pid即可
更新 yum 缓存:
sudo yum makecache fast
安装 Docker-ce:
sudo yum -y install docker-ce
启动 Docker 后台服务
sudo systemctl start docker
测试运行 hello-world
[root@localhost xxxxxx]# docker run hello-world

本文部分内容来自网上,将自己学习及实践过程记下来以便将来回顾,能给别人提供参考更好
本文详细介绍了在CentOS环境下从移除旧版本到安装最新版Docker-ce的全过程,包括更新系统工具、添加软件源、更新yum缓存、安装及启动Docker后台服务,并通过运行hello-world进行测试。
1206

被折叠的 条评论
为什么被折叠?



