CentOS下docker安装

本文详细介绍了在CentOS环境下从移除旧版本到安装最新版Docker-ce的全过程,包括更新系统工具、添加软件源、更新yum缓存、安装及启动Docker后台服务,并通过运行hello-world进行测试。

安装环境 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

本文部分内容来自网上,将自己学习及实践过程记下来以便将来回顾,能给别人提供参考更好

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值