【Docker】从零开始:4.Docker安装
- 安装步骤
- 1.确定你是CentOS7及以上版本
- 2.卸载旧版本
- a.查看是否已安装docker
- b.如何安装了卸载docker
- 3.通过yum安装gcc相关依赖包
- 4.安装需要的软件包
- 5.设置yum stable镜像仓库 (源)
- 1.备份源
- 2.配置源
- 阿里云仓库
- 网易源
- 腾讯源
- 华为源
- 清华源
- 6.更新yum软件包索引
- 7.安装DOCKER CE
- 8.启动docker
- 9.测试
- 卸载Docker
- 1.停止docker
- 2. 卸载安装的软件
- 3.删除docker相关目录
官方安装指导
安装步骤
1.确定你是CentOS7及以上版本
[root@docker ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@docker ~]#
2.卸载旧版本
a.查看是否已安装docker
[root@docker ~]# rpm -qc docker
未安装软件包 docker
[root@docker ~]#
b.如何安装了卸载docker
yum remove docker \docker-client \docker-client-latest \docker-common \docker-latest \docker-latest-logrotate \docker-logrotate \docker-engine
3.通过yum安装gcc相关依赖包
- 如果安装较慢或者经常卡住,先进行第5步
yum install -y gcc yum install -y gcc-c++
执行后的效果
[root@docker ~]# yum install -y gcc
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.ustc.edu.cn* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 gcc.x86_64.0.4.8.5-44.el7 将被 安装
--> 正在处理依赖关系 cpp = 4.8.5-44.el7,它被软件包 gcc-4.8.5-44.el7.x86_64 需要
--> 正在处理依赖关系 glibc-devel >= 2.2.90-12,它被软件包 gcc-4.8.5-44.el7.x86_64 需要
--> 正在处理依赖关系 libmpfr.so.4()(64bit),它被软件包 gcc-4.8.5-44.el7.x86_64 需要
--> 正在处理依赖关系 libmpc.so.3()(64bit),它被软件包 gcc-4.8.5-44.el7.x86_64 需要
--> 正在检查事务
---> 软件包 cpp.x86_64.0.4.8.5-44.el7 将被 安装
---> 软件包 glibc-devel.x86_64.0.2.17-326.el7_9 将被 安装
--> 正在处理依赖关系 glibc-headers = 2.17-326.el7_9,它被软件包 glibc-devel-2.17-326.el7_9.x86_64 需要
--> 正在处理依赖关系 glibc = 2.17-326.el7_9,它被软件包 glibc-devel-2.17-326.el7_9.x86_64 需要
--> 正在处理依赖关系 glibc-headers,它被软件包 glibc-devel-2.17-326.el7_9.x86_64 需要
---> 软件包 libmpc.x86_64.0.1.0.1-3.el7 将被 安装
---> 软件包 mpfr.x86_64.0.3.1.1-4.el7 将被 安装
--> 正在检查事务
---> 软件包 glibc.x86_64.0.2.17-317.el7 将被 升级
--> 正在处理依赖关系 glibc = 2.17-317.el7,它被软件包 glibc-common-2.17-317.el7.x86_64 需要
---> 软件包 glibc.x86_64.0.2.17-326.el7_9 将被 更新
---> 软件包 glibc-headers.x86_64.0.2.17-326.el7_9 将被 安装
--> 正在处理依赖关系 kernel-headers >= 2.2.1,它被软件包 glibc-headers-2.17-326.el7_9.x86_64 需要
--> 正在处理依赖关系 kernel-headers,它被软件包 glibc-headers-2.17-326.el7_9.x86_64 需要
--> 正在检查事务
---> 软件包 glibc-common.x86_64.0.2.17-317.el7 将被 升级
---> 软件包 glibc-common.x86_64.0.2.17-326.el7_9 将被 更新
---> 软件包 kernel-headers.x86_64.0.3.10.0-1160.102.1.el7 将被 安装
--> 解决依赖关系完成依赖关系解决=================================================================================================================================================================================================================================================Package 架构 版本 源 大小
=================================================================================================================================================================================================================================================
正在安装:gcc x86_64 4.8.5-44.el7 base 16 M
为依赖而安装:cpp x86_64 4.8.5-44.el7 base 5.9 Mglibc-devel x86_64 2.17-326.el7_9 updates 1.1 Mglibc-headers x86_64 2.17-326.el7_9 updates 691 kkernel-headers x86_64 3.10.0-1160.102.1.el7 updates 9.1 Mlibmpc x86_64 1.0.1-3.el7 base 51 kmpfr x86_64 3.1.1-4.el7 base 203 k
为依赖而更新:glibc x86_64 2.17-326.el7_9 updates 3.6 Mglibc-common x86_64 2.17-326.el7_9 updates 12 M事务概要
=================================================================================================================================================================================================================================================
安装 1 软件包 (+6 依赖软件包)
升级 ( 2 依赖软件包)总下载量:48 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
警告:/var/cache/yum/x86_64/7/updates/packages/glibc-devel-2.17-326.el7_9.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY ] 0.0 B/s | 10 MB --:--:-- ETA
glibc-devel-2.17-326.el7_9.x86_64.rpm 的公钥尚未安装
(1/9): glibc-devel-2.17-326.el7_9.x86_64.rpm | 1.1 MB 00:00:00
(2/9): glibc-common-2.17-326.el7_9.x86_64.rpm | 12 MB 00:00:00
(3/9): glibc-2.17-326.el7_9.x86_64.rpm | 3.6 MB 00:00:00
(4/9): glibc-headers-2.17-326.el7_9.x86_64.rpm | 691 kB 00:00:00
mpfr-3.1.1-4.el7.x86_64.rpm 的公钥尚未安装 47% [=============================================- ] 21 MB/s | 23 MB 00:00:01 ETA
(5/9): mpfr-3.1.1-4.el7.x86_64.rpm | 203 kB 00:00:00
(6/9): cpp-4.8.5-44.el7.x86_64.rpm | 5.9 MB 00:00:01
(7/9): libmpc-1.0.1-3.el7.x86_64.rpm | 51 kB 00:00:00
(8/9): kernel-headers-3.10.0-1160.102.1.el7.x86_64.rpm | 9.1 MB 00:00:00
(9/9): gcc-4.8.5-44.el7.x86_64.rpm | 16 MB 00:00:01
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 32 MB/s | 48 MB 00:00:01
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5软件包 : centos-release-7-9.2009.0.el7.centos.x86_64 (@anaconda)来自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在更新 : glibc-2.17-326.el7_9.x86_64 1/11 正在更新 : glibc-common-2.17-326.el7_9.x86_64 2/11 正在安装 : mpfr-3.1.1-4.el7.x86_64 3/11 正在安装 : libmpc-1.0.1-3.el7.x86_64 4/11 正在安装 : cpp-4.8.5-44.el7.x86_64 5/11 正在安装 : kernel-headers-3.10.0-1160.102.1.el7.x86_64 6/11 正在安装 : glibc-headers-2.17-326.el7_9.x86_64 7/11 正在安装 : glibc-devel-2.17-326.el7_9.x86_64 8/11 正在安装 : gcc-4.8.5-44.el7.x86_64 9/11 清理 : glibc-2.17-317.el7.x86_64 10/11 清理 : glibc-common-2.17-317.el7.x86_64 11/11 验证中 : glibc-common-2.17-326.el7_9.x86_64 1/11 验证中 : glibc-2.17-326.el7_9.x86_64 2/11 验证中 : mpfr-3.1.1-4.el7.x86_64 3/11 验证中 : glibc-devel-2.17-326.el7_9.x86_64 4/11 验证中 : cpp-4.8.5-44.el7.x86_64 5/11 验证中 : glibc-headers-2.17-326.el7_9.x86_64 6/11 验证中 : gcc-4.8.5-44.el7.x86_64 7/11 验证中 : libmpc-1.0.1-3.el7.x86_64 8/11 验证中 : kernel-headers-3.10.0-1160.102.1.el7.x86_64 9/11 验证中 : glibc-2.17-317.el7.x86_64 10/11 验证中 : glibc-common-2.17-317.el7.x86_64 11/11 已安装:gcc.x86_64 0:4.8.5-44.el7 作为依赖被安装:cpp.x86_64 0:4.8.5-44.el7 glibc-devel.x86_64 0:2.17-326.el7_9 glibc-headers.x86_64 0:2.17-326.el7_9 kernel-headers.x86_64 0:3.10.0-1160.102.1.el7 libmpc.x86_64 0:1.0.1-3.el7 mpfr.x86_64 0:3.1.1-4.el7 作为依赖被升级:glibc.x86_64 0:2.17-326.el7_9 glibc-common.x86_64 0:2.17-326.el7_9 完毕!
[root@docker ~]# yum install -y gcc-c++
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: ftp.sjtu.edu.cn* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 gcc-c++.x86_64.0.4.8.5-44.el7 将被 安装
--> 正在处理依赖关系 libstdc++-devel = 4.8.5-44.el7,它被软件包 gcc-c++-4.8.5-44.el7.x86_64 需要
--> 正在检查事务
---> 软件包 libstdc++-devel.x86_64.0.4.8.5-44.el7 将被 安装
--> 解决依赖关系完成依赖关系解决=================================================================================================================================================================================================================================================Package 架构 版本 源 大小
=================================================================================================================================================================================================================================================
正在安装:gcc-c++ x86_64 4.8.5-44.el7 base 7.2 M
为依赖而安装:libstdc++-devel x86_64 4.8.5-44.el7 base 1.5 M事务概要
=================================================================================================================================================================================================================================================
安装 1 软件包 (+1 依赖软件包)总下载量:8.7 M
安装大小:25 M
Downloading packages:
(1/2): gcc-c++-4.8.5-44.el7.x86_64.rpm | 7.2 MB 00:00:00
(2/2): libstdc++-devel-4.8.5-44.el7.x86_64.rpm | 1.5 MB 00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 13 MB/s | 8.7 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装 : libstdc++-devel-4.8.5-44.el7.x86_64 1/2 正在安装 : gcc-c++-4.8.5-44.el7.x86_64 2/2 验证中 : gcc-c++-4.8.5-44.el7.x86_64 1/2 验证中 : libstdc++-devel-4.8.5-44.el7.x86_64 2/2 已安装:gcc-c++.x86_64 0:4.8.5-44.el7 作为依赖被安装:libstdc++-devel.x86_64 0:4.8.5-44.el7 完毕!
4.安装需要的软件包
yum install -y yum-utils
结果如下:
[root@docker ~]# yum install -y yum-utils
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.bfsu.edu.cn* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 yum-utils.noarch.0.1.1.31-54.el7_8 将被 安装
--> 正在处理依赖关系 python-kitchen,它被软件包 yum-utils-1.1.31-54.el7_8.noarch 需要
--> 正在处理依赖关系 libxml2-python,它被软件包 yum-utils-1.1.31-54.el7_8.noarch 需要
--> 正在检查事务
---> 软件包 libxml2-python.x86_64.0.2.9.1-6.el7_9.6 将被 安装
--> 正在处理依赖关系 libxml2 = 2.9.1-6.el7_9.6,它被软件包 libxml2-python-2.9.1-6.el7_9.6.x86_64 需要
---> 软件包 python-kitchen.noarch.0.1.1.1-5.el7 将被 安装
--> 正在处理依赖关系 python-chardet,它被软件包 python-kitchen-1.1.1-5.el7.noarch 需要
--> 正在检查事务
---> 软件包 libxml2.x86_64.0.2.9.1-6.el7.5 将被 升级
---> 软件包 libxml2.x86_64.0.2.9.1-6.el7_9.6 将被 更新
---> 软件包 python-chardet.noarch.0.2.2.1-3.el7 将被 安装
--> 解决依赖关系完成依赖关系解决=================================================================================================================================================================================================================================================Package 架构 版本 源 大小
=================================================================================================================================================================================================================================================
正在安装:yum-utils noarch 1.1.31-54.el7_8 base 122 k
为依赖而安装:libxml2-python x86_64 2.9.1-6.el7_9.6 updates 247 kpython-chardet noarch 2.2.1-3.el7 base 227 kpython-kitchen noarch 1.1.1-5.el7 base 267 k
为依赖而更新:libxml2 x86_64 2.9.1-6.el7_9.6 updates 668 k事务概要
=================================================================================================================================================================================================================================================
安装 1 软件包 (+3 依赖软件包)
升级 ( 1 依赖软件包)总下载量:1.5 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/5): libxml2-2.9.1-6.el7_9.6.x86_64.rpm | 668 kB 00:00:00
(2/5): yum-utils-1.1.31-54.el7_8.noarch.rpm | 122 kB 00:00:00
(3/5): python-chardet-2.2.1-3.el7.noarch.rpm | 227 kB 00:00:00
(4/5): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:00:00
(5/5): libxml2-python-2.9.1-6.el7_9.6.x86_64.rpm | 247 kB 00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 2.0 MB/s | 1.5 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在更新 : libxml2-2.9.1-6.el7_9.6.x86_64 1/6 正在安装 : libxml2-python-2.9.1-6.el7_9.6.x86_64 2/6 正在安装 : python-chardet-2.2.1-3.el7.noarch 3/6 正在安装 : python-kitchen-1.1.1-5.el7.noarch 4/6 正在安装 : yum-utils-1.1.31-54.el7_8.noarch 5/6 清理 : libxml2-2.9.1-6.el7.5.x86_64 6/6 验证中 : python-chardet-2.2.1-3.el7.noarch 1/6 验证中 : libxml2-2.9.1-6.el7_9.6.x86_64 2/6 验证中 : libxml2-python-2.9.1-6.el7_9.6.x86_64 3/6 验证中 : python-kitchen-1.1.1-5.el7.noarch 4/6 验证中 : yum-utils-1.1.31-54.el7_8.noarch 5/6 验证中 : libxml2-2.9.1-6.el7.5.x86_64 6/6 已安装:yum-utils.noarch 0:1.1.31-54.el7_8 作为依赖被安装:libxml2-python.x86_64 0:2.9.1-6.el7_9.6 python-chardet.noarch 0:2.2.1-3.el7 python-kitchen.noarch 0:1.1.1-5.el7 作为依赖被升级:libxml2.x86_64 0:2.9.1-6.el7_9.6 完毕!
[root@docker ~]#
5.设置yum stable镜像仓库 (源)
以下提供几个国内仓库
1.备份源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.配置源
- 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/下
[root@docker ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tencent.com/repo/centos7_base.repo
-bash: wget: 未找到命令
[root@docker ~]#
以上问题是没有安装wget,通过yum先安装wget就可以执行成功了
yum install -y wget
再次执行
[root@docker ~]# yum install -y wget
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.ustc.edu.cn* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 wget.x86_64.0.1.14-18.el7_6.1 将被 安装
--> 解决依赖关系完成依赖关系解决=================================================================================================================================================================================================================================================Package 架构 版本 源 大小
=================================================================================================================================================================================================================================================
正在安装:wget x86_64 1.14-18.el7_6.1 base 547 k事务概要
=================================================================================================================================================================================================================================================
安装 1 软件包总下载量:547 k
安装大小:2.0 M
Downloading packages:
wget-1.14-18.el7_6.1.x86_64.rpm | 547 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装 : wget-1.14-18.el7_6.1.x86_64 1/1 验证中 : wget-1.14-18.el7_6.1.x86_64 1/1 已安装:wget.x86_64 0:1.14-18.el7_6.1 完毕!
[root@docker ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tencent.com/repo/centos7_base.repo
--2023-11-21 19:37:43-- https://mirrors.tencent.com/repo/centos7_base.repo
正在解析主机 mirrors.tencent.com (mirrors.tencent.com)... 183.255.119.102, 183.255.119.199, 111.29.14.62
正在连接 mirrors.tencent.com (mirrors.tencent.com)|183.255.119.102|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1694 (1.7K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”100%[=======================================================================================================================================================================================================>] 1,694 --.-K/s 用时 0s 2023-11-21 19:37:44 (3.34 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [1694/1694])[root@docker ~]#
我也不知道啥原因 有时候国内源都找不到docker-ce这些软件 我右恢复了官方提供的源结果成功了
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
推荐以下几个源
阿里云仓库
阿里云官方地址
- centos8(centos8官方源已下线,建议切换centos-vault源)
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
- CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
- centos6(centos6官方源已下线,建议切换centos-vault源)
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
非阿里云ECS用户会出现 Couldn’t resolve host ‘mirrors.cloud.aliyuncs.com’ 信息,不影响使用。用户也可自行修改相关配置:
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
网易源
网易源官方地址
- CentOS7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
- CentOS6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
- CentOS5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
腾讯源
腾讯源官方地址
centos stream 8/9:用镜像中自带的 repo 文件即可。
- CentOS7:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tencent.com/repo/centos7_base.repo
- CentOS6:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.cloud.tencent.com/repo/centos6_base.repo
华为源
华为源官方网站
CentOS7
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-7-anon.repo
CentOS8
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-7-anon.repo
清华源
清华源官方网站
*为通配符
sed -e 's|^mirrorlist=|#mirrorlist=|g' \-e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' \-i.bak \/etc/yum.repos.d/CentOS-*.repo
6.更新yum软件包索引
- 执行yum clean all清除原有yum缓存。
- 执行yum makecache(刷新缓存)或者yum repolist all(查看所有配置可以使用的文件,会自动刷新缓存)。
yum clean all
yum makecache fast
[root@docker ~]# yum clean all
已加载插件:fastestmirror
Repository cr is listed more than once in the configuration
Repository fasttrack is listed more than once in the configuration
正在清理软件源: extras os updates
Cleaning up list of fastest mirrors
Other repos take up 36 M of disk space (use --verbose for details)
[root@docker ~]# yum makecache fast
已加载插件:fastestmirror
Repository cr is listed more than once in the configuration
Repository fasttrack is listed more than once in the configuration
Determining fastest mirrors
extras | 2.9 kB 00:00:00
os | 3.6 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/10): extras/7/x86_64/filelists_db | 303 kB 00:00:00
(2/10): extras/7/x86_64/primary_db | 250 kB 00:00:00
(3/10): extras/7/x86_64/other_db | 150 kB 00:00:00
(4/10): os/7/x86_64/group_gz | 153 kB 00:00:00
(5/10): os/7/x86_64/primary_db | 6.1 MB 00:00:00
(6/10): os/7/x86_64/other_db | 2.6 MB 00:00:00
(7/10): updates/7/x86_64/filelists_db | 13 MB 00:00:00
(8/10): updates/7/x86_64/other_db | 1.5 MB 00:00:00
(9/10): os/7/x86_64/filelists_db | 7.2 MB 00:00:02
(10/10): updates/7/x86_64/primary_db | 24 MB 00:00:01
元数据缓存已建立
[root@docker ~]#
7.安装DOCKER CE
yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
结果如下
[root@docker ~]# yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
没有可用软件包 docker-ce。
没有可用软件包 docker-ce-cli。
没有可用软件包 containerd.io。
没有可用软件包 docker-buildx-plugin。
没有可用软件包 docker-compose-plugin。
错误:无须任何处理
[root@docker ~]# yum -y install epel-release
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 安装
--> 解决依赖关系完成依赖关系解决=================================================================================================================================================================================================================================================Package 架构 版本 源 大小
=================================================================================================================================================================================================================================================
正在安装:epel-release noarch 7-11 extras 15 k事务概要
=================================================================================================================================================================================================================================================
安装 1 软件包总下载量:15 k
安装大小:24 k
Downloading packages:
epel-release-7-11.noarch.rpm | 15 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装 : epel-release-7-11.noarch 1/1 验证中 : epel-release-7-11.noarch 1/1 已安装:epel-release.noarch 0:7-11 完毕!
[root@docker ~]# yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 6.9 kB 00:00:00 * base: mirrors.aliyun.com* epel: mirror.nyist.edu.cn* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
epel | 4.7 kB 00:00:00
(1/3): epel/x86_64/group_gz | 99 kB 00:00:00
(2/3): epel/x86_64/primary_db | 7.0 MB 00:00:00
(3/3): epel/x86_64/updateinfo | 1.0 MB 00:00:00
没有可用软件包 docker-ce。
没有可用软件包 docker-ce-cli。
没有可用软件包 containerd.io。
没有可用软件包 docker-buildx-plugin。
没有可用软件包 docker-compose-plugin。
错误:无须任何处理
[root@docker ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
--2023-11-21 19:48:20-- https://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 112.48.164.65, 183.240.215.237, 183.240.82.186, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|112.48.164.65|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2523 (2.5K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”100%[=======================================================================================================================================================================================================>] 2,523 --.-K/s 用时 0s 2023-11-21 19:48:20 (364 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2523/2523])[root@docker ~]# yum clean all
已加载插件:fastestmirror
正在清理软件源: base epel extras updates
Cleaning up list of fastest mirrors
Other repos take up 112 M of disk space (use --verbose for details)
[root@docker ~]# yum makecache
已加载插件:fastestmirror
Determining fastest mirrors
epel/x86_64/metalink | 6.9 kB 00:00:00 * base: mirrors.aliyun.com* epel: mirrors.bfsu.edu.cn* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/16): base/7/x86_64/group_gz | 153 kB 00:00:00
(2/16): base/7/x86_64/primary_db | 6.1 MB 00:00:00
(3/16): base/7/x86_64/other_db | 2.6 MB 00:00:00
(4/16): epel/x86_64/group_gz | 99 kB 00:00:00
(5/16): epel/x86_64/filelists_db | 12 MB 00:00:00
(6/16): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(7/16): epel/x86_64/prestodelta | 1.0 kB 00:00:00
(8/16): base/7/x86_64/filelists_db | 7.2 MB 00:00:01
(9/16): epel/x86_64/primary_db | 7.0 MB 00:00:00
(10/16): epel/x86_64/other_db | 3.4 MB 00:00:00
(11/16): extras/7/x86_64/filelists_db | 303 kB 00:00:00
(12/16): extras/7/x86_64/primary_db | 250 kB 00:00:00
(13/16): extras/7/x86_64/other_db | 150 kB 00:00:00
(14/16): updates/7/x86_64/primary_db | 24 MB 00:00:01
(15/16): updates/7/x86_64/filelists_db | 13 MB 00:00:01
(16/16): updates/7/x86_64/other_db | 1.5 MB 00:00:00
元数据缓存已建立
[root@docker ~]# yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* epel: mirrors.bfsu.edu.cn* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
没有可用软件包 docker-ce。
没有可用软件包 docker-ce-cli。
没有可用软件包 containerd.io。
没有可用软件包 docker-buildx-plugin。
没有可用软件包 docker-compose-plugin。
错误:无须任何处理
[root@docker ~]# wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
--2023-11-21 19:50:41-- https://mirrors.aliyun.com/repo/epel-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 183.240.82.190, 183.232.204.183, 183.240.215.235, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|183.240.82.190|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:664 [application/octet-stream]
正在保存至: “/etc/yum.repos.d/epel.repo”100%[=======================================================================================================================================================================================================>] 664 --.-K/s 用时 0s 2023-11-21 19:50:41 (126 MB/s) - 已保存 “/etc/yum.repos.d/epel.repo” [664/664])[root@docker ~]# yum clean all
已加载插件:fastestmirror
正在清理软件源: base epel extras updates
Cleaning up list of fastest mirrors
Other repos take up 112 M of disk space (use --verbose for details)
[root@docker ~]# yum makecache
已加载插件:fastestmirror
Determining fastest mirrors* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/16): base/7/x86_64/group_gz | 153 kB 00:00:00
(2/16): base/7/x86_64/primary_db | 6.1 MB 00:00:00
(3/16): base/7/x86_64/other_db | 2.6 MB 00:00:00
(4/16): epel/x86_64/group_gz | 99 kB 00:00:00
(5/16): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(6/16): base/7/x86_64/filelists_db | 7.2 MB 00:00:01
(7/16): epel/x86_64/prestodelta | 1.0 kB 00:00:00
(8/16): epel/x86_64/filelists_db | 12 MB 00:00:01
(9/16): epel/x86_64/other_db | 3.4 MB 00:00:00
(10/16): extras/7/x86_64/primary_db | 250 kB 00:00:00
(11/16): extras/7/x86_64/filelists_db | 303 kB 00:00:00
(12/16): epel/x86_64/primary_db | 7.0 MB 00:00:00
(13/16): extras/7/x86_64/other_db | 150 kB 00:00:00
(14/16): updates/7/x86_64/filelists_db | 13 MB 00:00:02
(15/16): updates/7/x86_64/other_db | 1.5 MB 00:00:00
(16/16): updates/7/x86_64/primary_db | 24 MB 00:00:03
元数据缓存已建立
[root@docker ~]# yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
没有可用软件包 docker-ce。
没有可用软件包 docker-ce-cli。
没有可用软件包 containerd.io。
没有可用软件包 docker-buildx-plugin。
没有可用软件包 docker-compose-plugin。
错误:无须任何处理
[root@docker ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
已加载插件:fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@docker ~]# yum clean all
已加载插件:fastestmirror
正在清理软件源: base docker-ce-stable epel extras updates
Cleaning up list of fastest mirrors
Other repos take up 112 M of disk space (use --verbose for details)
[root@docker ~]# yum makecache
已加载插件:fastestmirror
Determining fastest mirrors* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/20): base/7/x86_64/group_gz | 153 kB 00:00:00
(2/20): base/7/x86_64/primary_db | 6.1 MB 00:00:00
(3/20): base/7/x86_64/filelists_db | 7.2 MB 00:00:01
(4/20): base/7/x86_64/other_db | 2.6 MB 00:00:00
(5/20): docker-ce-stable/7/x86_64/updateinfo | 55 B 00:00:00
(6/20): docker-ce-stable/7/x86_64/filelists_db | 51 kB 00:00:00
(7/20): docker-ce-stable/7/x86_64/other_db | 135 kB 00:00:00
(8/20): docker-ce-stable/7/x86_64/primary_db | 118 kB 00:00:00
(9/20): epel/x86_64/group_gz | 99 kB 00:00:00
(10/20): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(11/20): epel/x86_64/prestodelta | 1.0 kB 00:00:00
(12/20): epel/x86_64/primary_db | 7.0 MB 00:00:00
(13/20): extras/7/x86_64/primary_db | 250 kB 00:00:00
(14/20): extras/7/x86_64/other_db | 150 kB 00:00:00
(15/20): epel/x86_64/other_db | 3.4 MB 00:00:00
(16/20): extras/7/x86_64/filelists_db | 303 kB 00:00:00
(17/20): epel/x86_64/filelists_db | 12 MB 00:00:01
(18/20): updates/7/x86_64/filelists_db | 13 MB 00:00:01
(19/20): updates/7/x86_64/other_db | 1.5 MB 00:00:00
(20/20): updates/7/x86_64/primary_db | 24 MB 00:00:01
元数据缓存已建立
[root@docker ~]# yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 containerd.io.x86_64.0.1.6.25-3.1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 containerd.io-1.6.25-3.1.el7.x86_64 需要
---> 软件包 docker-buildx-plugin.x86_64.0.0.11.2-1.el7 将被 安装
---> 软件包 docker-ce.x86_64.3.24.0.7-1.el7 将被 安装
--> 正在处理依赖关系 docker-ce-rootless-extras,它被软件包 3:docker-ce-24.0.7-1.el7.x86_64 需要
--> 正在处理依赖关系 libcgroup,它被软件包 3:docker-ce-24.0.7-1.el7.x86_64 需要
---> 软件包 docker-ce-cli.x86_64.1.24.0.7-1.el7 将被 安装
---> 软件包 docker-compose-plugin.x86_64.0.2.21.0-1.el7 将被 安装
--> 正在检查事务
---> 软件包 container-selinux.noarch.2.2.119.2-1.911c772.el7_8 将被 安装
--> 正在处理依赖关系 policycoreutils-python,它被软件包 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 需要
---> 软件包 docker-ce-rootless-extras.x86_64.0.24.0.7-1.el7 将被 安装
--> 正在处理依赖关系 fuse-overlayfs >= 0.7,它被软件包 docker-ce-rootless-extras-24.0.7-1.el7.x86_64 需要
--> 正在处理依赖关系 slirp4netns >= 0.4,它被软件包 docker-ce-rootless-extras-24.0.7-1.el7.x86_64 需要
---> 软件包 libcgroup.x86_64.0.0.41-21.el7 将被 安装
--> 正在检查事务
---> 软件包 fuse-overlayfs.x86_64.0.0.7.2-6.el7_8 将被 安装
--> 正在处理依赖关系 libfuse3.so.3(FUSE_3.2)(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
--> 正在处理依赖关系 libfuse3.so.3(FUSE_3.0)(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
--> 正在处理依赖关系 libfuse3.so.3()(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
---> 软件包 policycoreutils-python.x86_64.0.2.5-34.el7 将被 安装
--> 正在处理依赖关系 setools-libs >= 3.3.8-4,它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
--> 正在处理依赖关系 libsemanage-python >= 2.5-14,它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
--> 正在处理依赖关系 audit-libs-python >= 2.1.3-4,它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
--> 正在处理依赖关系 python-IPy,它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
--> 正在处理依赖关系 libqpol.so.1(VERS_1.4)(64bit),它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
--> 正在处理依赖关系 libqpol.so.1(VERS_1.2)(64bit),它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
--> 正在处理依赖关系 libapol.so.4(VERS_4.0)(64bit),它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
--> 正在处理依赖关系 checkpolicy,它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
--> 正在处理依赖关系 libqpol.so.1()(64bit),它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
--> 正在处理依赖关系 libapol.so.4()(64bit),它被软件包 policycoreutils-python-2.5-34.el7.x86_64 需要
---> 软件包 slirp4netns.x86_64.0.0.4.3-4.el7_8 将被 安装
--> 正在检查事务
---> 软件包 audit-libs-python.x86_64.0.2.8.5-4.el7 将被 安装
---> 软件包 checkpolicy.x86_64.0.2.5-8.el7 将被 安装
---> 软件包 fuse3-libs.x86_64.0.3.6.1-4.el7 将被 安装
---> 软件包 libsemanage-python.x86_64.0.2.5-14.el7 将被 安装
---> 软件包 python-IPy.noarch.0.0.75-6.el7 将被 安装
---> 软件包 setools-libs.x86_64.0.3.3.8-4.el7 将被 安装
--> 解决依赖关系完成依赖关系解决=================================================================================================================================================================================================================================================Package 架构 版本 源 大小
=================================================================================================================================================================================================================================================
正在安装:containerd.io x86_64 1.6.25-3.1.el7 docker-ce-stable 34 Mdocker-buildx-plugin x86_64 0.11.2-1.el7 docker-ce-stable 13 Mdocker-ce x86_64 3:24.0.7-1.el7 docker-ce-stable 24 Mdocker-ce-cli x86_64 1:24.0.7-1.el7 docker-ce-stable 13 Mdocker-compose-plugin x86_64 2.21.0-1.el7 docker-ce-stable 13 M
为依赖而安装:audit-libs-python x86_64 2.8.5-4.el7 base 76 kcheckpolicy x86_64 2.5-8.el7 base 295 kcontainer-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 kdocker-ce-rootless-extras x86_64 24.0.7-1.el7 docker-ce-stable 9.1 Mfuse-overlayfs x86_64 0.7.2-6.el7_8 extras 54 kfuse3-libs x86_64 3.6.1-4.el7 extras 82 klibcgroup x86_64 0.41-21.el7 base 66 klibsemanage-python x86_64 2.5-14.el7 base 113 kpolicycoreutils-python x86_64 2.5-34.el7 base 457 kpython-IPy noarch 0.75-6.el7 base 32 ksetools-libs x86_64 3.3.8-4.el7 base 620 kslirp4netns x86_64 0.4.3-4.el7_8 extras 81 k事务概要
=================================================================================================================================================================================================================================================
安装 5 软件包 (+12 依赖软件包)总下载量:108 M
安装大小:383 M
Is this ok [y/d/N]: y
Downloading packages:
(1/17): audit-libs-python-2.8.5-4.el7.x86_64.rpm | 76 kB 00:00:00
(2/17): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm | 40 kB 00:00:00
(3/17): checkpolicy-2.5-8.el7.x86_64.rpm | 295 kB 00:00:00
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-buildx-plugin-0.11.2-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY ] 8.1 MB/s | 31 MB 00:00:09 ETA
docker-buildx-plugin-0.11.2-1.el7.x86_64.rpm 的公钥尚未安装
(4/17): docker-buildx-plugin-0.11.2-1.el7.x86_64.rpm | 13 MB 00:00:01
(5/17): containerd.io-1.6.25-3.1.el7.x86_64.rpm | 34 MB 00:00:01
(6/17): docker-ce-24.0.7-1.el7.x86_64.rpm | 24 MB 00:00:00
(7/17): docker-ce-cli-24.0.7-1.el7.x86_64.rpm | 13 MB 00:00:00
(8/17): docker-ce-rootless-extras-24.0.7-1.el7.x86_64.rpm | 9.1 MB 00:00:00
(9/17): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm | 54 kB 00:00:00
(10/17): libcgroup-0.41-21.el7.x86_64.rpm | 66 kB 00:00:00
(11/17): policycoreutils-python-2.5-34.el7.x86_64.rpm | 457 kB 00:00:00
(12/17): python-IPy-0.75-6.el7.noarch.rpm | 32 kB 00:00:00
(13/17): fuse3-libs-3.6.1-4.el7.x86_64.rpm | 82 kB 00:00:00
(14/17): docker-compose-plugin-2.21.0-1.el7.x86_64.rpm | 13 MB 00:00:00
(15/17): setools-libs-3.3.8-4.el7.x86_64.rpm | 620 kB 00:00:00
(16/17): libsemanage-python-2.5-14.el7.x86_64.rpm | 113 kB 00:00:00
(17/17): slirp4netns-0.4.3-4.el7_8.x86_64.rpm | 81 kB 00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 32 MB/s | 108 MB 00:00:03
从 https://download.docker.com/linux/centos/gpg 检索密钥
导入 GPG key 0x621E9F35:用户ID : "Docker Release (CE rpm) <docker@docker.com>"指纹 : 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35来自 : https://download.docker.com/linux/centos/gpg
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装 : libcgroup-0.41-21.el7.x86_64 1/17 正在安装 : docker-buildx-plugin-0.11.2-1.el7.x86_64 2/17 正在安装 : setools-libs-3.3.8-4.el7.x86_64 3/17 正在安装 : audit-libs-python-2.8.5-4.el7.x86_64 4/17 正在安装 : fuse3-libs-3.6.1-4.el7.x86_64 5/17 正在安装 : fuse-overlayfs-0.7.2-6.el7_8.x86_64 6/17 正在安装 : python-IPy-0.75-6.el7.noarch 7/17 正在安装 : slirp4netns-0.4.3-4.el7_8.x86_64 8/17 正在安装 : libsemanage-python-2.5-14.el7.x86_64 9/17 正在安装 : docker-compose-plugin-2.21.0-1.el7.x86_64 10/17 正在安装 : 1:docker-ce-cli-24.0.7-1.el7.x86_64 11/17 正在安装 : checkpolicy-2.5-8.el7.x86_64 12/17 正在安装 : policycoreutils-python-2.5-34.el7.x86_64 13/17 正在安装 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 14/17 正在安装 : containerd.io-1.6.25-3.1.el7.x86_64 15/17 正在安装 : docker-ce-rootless-extras-24.0.7-1.el7.x86_64 16/17 正在安装 : 3:docker-ce-24.0.7-1.el7.x86_64 17/17 验证中 : containerd.io-1.6.25-3.1.el7.x86_64 1/17 验证中 : 3:docker-ce-24.0.7-1.el7.x86_64 2/17 验证中 : checkpolicy-2.5-8.el7.x86_64 3/17 验证中 : docker-ce-rootless-extras-24.0.7-1.el7.x86_64 4/17 验证中 : docker-compose-plugin-2.21.0-1.el7.x86_64 5/17 验证中 : libsemanage-python-2.5-14.el7.x86_64 6/17 验证中 : slirp4netns-0.4.3-4.el7_8.x86_64 7/17 验证中 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 8/17 验证中 : python-IPy-0.75-6.el7.noarch 9/17 验证中 : 1:docker-ce-cli-24.0.7-1.el7.x86_64 10/17 验证中 : policycoreutils-python-2.5-34.el7.x86_64 11/17 验证中 : fuse3-libs-3.6.1-4.el7.x86_64 12/17 验证中 : audit-libs-python-2.8.5-4.el7.x86_64 13/17 验证中 : setools-libs-3.3.8-4.el7.x86_64 14/17 验证中 : docker-buildx-plugin-0.11.2-1.el7.x86_64 15/17 验证中 : fuse-overlayfs-0.7.2-6.el7_8.x86_64 16/17 验证中 : libcgroup-0.41-21.el7.x86_64 17/17 已安装:containerd.io.x86_64 0:1.6.25-3.1.el7 docker-buildx-plugin.x86_64 0:0.11.2-1.el7 docker-ce.x86_64 3:24.0.7-1.el7 docker-ce-cli.x86_64 1:24.0.7-1.el7 docker-compose-plugin.x86_64 0:2.21.0-1.el7 作为依赖被安装:audit-libs-python.x86_64 0:2.8.5-4.el7 checkpolicy.x86_64 0:2.5-8.el7 container-selinux.noarch 2:2.119.2-1.911c772.el7_8 docker-ce-rootless-extras.x86_64 0:24.0.7-1.el7 fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 fuse3-libs.x86_64 0:3.6.1-4.el7 libcgroup.x86_64 0:0.41-21.el7 libsemanage-python.x86_64 0:2.5-14.el7 policycoreutils-python.x86_64 0:2.5-34.el7 python-IPy.noarch 0:0.75-6.el7 setools-libs.x86_64 0:3.3.8-4.el7 slirp4netns.x86_64 0:0.4.3-4.el7_8 完毕!
[root@docker ~]#
8.启动docker
- systemctl start docker 启动docker
- systemctl enable docker 设置docker为开机自启
systemctl start docker
systemctl enable docker
9.测试
docker version
[root@docker ~]# docker version
Client: Docker Engine - CommunityVersion: 24.0.7API version: 1.43Go version: go1.20.10Git commit: afdd53bBuilt: Thu Oct 26 09:11:35 2023OS/Arch: linux/amd64Context: defaultServer: Docker Engine - CommunityEngine:Version: 24.0.7API version: 1.43 (minimum version 1.12)Go version: go1.20.10Git commit: 311b9ffBuilt: Thu Oct 26 09:10:36 2023OS/Arch: linux/amd64Experimental: falsecontainerd:Version: 1.6.25GitCommit: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7frunc:Version: 1.1.10GitCommit: v1.1.10-0-g18a0cb0docker-init:Version: 0.19.0GitCommit: de40ad0
[root@docker ~]#
docker pull hello-world
docker run hello-world
[root@docker ~]# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
719385e32844: Pull complete
Digest: sha256:c79d06dfdfd3d3eb04cafd0dc2bacab0992ebc243e083cabe208bac4dd7759e0
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
[root@docker ~]# docker run hello-worldHello from Docker!
This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:1. The Docker client contacted the Docker daemon.2. The Docker daemon pulled the "hello-world" image from the Docker Hub.(amd64)3. The Docker daemon created a new container from that image which runs theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID:https://hub.docker.com/For more examples and ideas, visit:https://docs.docker.com/get-started/[root@docker ~]#
卸载Docker
1.停止docker
systemctl stop docker
2. 卸载安装的软件
yum remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
3.删除docker相关目录
rm -rf /var/lib/docker
rm -rf /var/lib/containerd