CentOS 7 使用yum安装Docker CE

1: 安装必要的一些系统工具

[root@localhost]# sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
base                                                                                             | 3.6 kB  00:00:00
extras                                                                                           | 2.9 kB  00:00:00
updates                                                                                          | 2.9 kB  00:00:00
(1/4): base/7/x86_64/group_gz                                                                    | 153 kB  00:00:00
(2/4): extras/7/x86_64/primary_db                                                                | 249 kB  00:00:00
(3/4): base/7/x86_64/primary_db                                                                  | 6.1 MB  00:00:01
(4/4): updates/7/x86_64/primary_db                                                               |  18 MB  00:00:05
Resolving Dependencies
--> Running transaction check
---> Package device-mapper-persistent-data.x86_64 0:0.7.3-3.el7 will be updated
---> Package device-mapper-persistent-data.x86_64 0:0.8.5-3.el7_9.2 will be an update
---> Package lvm2.x86_64 7:2.02.177-4.el7 will be updated
---> Package lvm2.x86_64 7:2.02.187-6.el7_9.5 will be an update
--> Processing Dependency: lvm2-libs = 7:2.02.187-6.el7_9.5 for package: 7:lvm2-2.02.187-6.el7_9.5.x86_64
---> Package yum-utils.noarch 0:1.1.31-54.el7_8 will be installed
--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-54.el7_8.noarch
--> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-54.el7_8.noarch
--> Running transaction check
---> Package libxml2-python.x86_64 0:2.9.1-6.el7_9.6 will be installed
--> Processing Dependency: libxml2 = 2.9.1-6.el7_9.6 for package: libxml2-python-2.9.1-6.el7_9.6.x86_64
---> Package lvm2-libs.x86_64 7:2.02.177-4.el7 will be updated
---> Package lvm2-libs.x86_64 7:2.02.187-6.el7_9.5 will be an update
--> Processing Dependency: device-mapper-event = 7:1.02.170-6.el7_9.5 for package: 7:lvm2-libs-2.02.187-6.el7_9.5.x86_64
---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
--> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
--> Running transaction check
---> Package device-mapper-event.x86_64 7:1.02.146-4.el7 will be updated
---> Package device-mapper-event.x86_64 7:1.02.170-6.el7_9.5 will be an update
--> Processing Dependency: device-mapper-event-libs = 7:1.02.170-6.el7_9.5 for package: 7:device-mapper-event-1.02.170-6.el7_9.5.x86_64
--> Processing Dependency: device-mapper = 7:1.02.170-6.el7_9.5 for package: 7:device-mapper-event-1.02.170-6.el7_9.5.x86_64
---> Package libxml2.x86_64 0:2.9.1-6.el7_2.3 will be updated
---> Package libxml2.x86_64 0:2.9.1-6.el7_9.6 will be an update
---> Package python-chardet.noarch 0:2.2.1-3.el7 will be installed
--> Running transaction check
---> Package device-mapper.x86_64 7:1.02.146-4.el7 will be updated
--> Processing Dependency: device-mapper = 7:1.02.146-4.el7 for package: 7:device-mapper-libs-1.02.146-4.el7.x86_64
---> Package device-mapper.x86_64 7:1.02.170-6.el7_9.5 will be an update
---> Package device-mapper-event-libs.x86_64 7:1.02.146-4.el7 will be updated
---> Package device-mapper-event-libs.x86_64 7:1.02.170-6.el7_9.5 will be an update
--> Running transaction check
---> Package device-mapper-libs.x86_64 7:1.02.146-4.el7 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.170-6.el7_9.5 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================
Package                                  Arch              Version                            Repository          Size
========================================================================================================================
Installing:
yum-utils                                noarch            1.1.31-54.el7_8                    base               122 k
Updating:
device-mapper-persistent-data            x86_64            0.8.5-3.el7_9.2                    updates            423 k
lvm2                                     x86_64            7:2.02.187-6.el7_9.5               updates            1.3 M
Installing for dependencies:
libxml2-python                           x86_64            2.9.1-6.el7_9.6                    updates            247 k
python-chardet                           noarch            2.2.1-3.el7                        base               227 k
python-kitchen                           noarch            1.1.1-5.el7                        base               267 k
Updating for dependencies:
device-mapper                            x86_64            7:1.02.170-6.el7_9.5               updates            297 k
device-mapper-event                      x86_64            7:1.02.170-6.el7_9.5               updates            192 k
device-mapper-event-libs                 x86_64            7:1.02.170-6.el7_9.5               updates            192 k
device-mapper-libs                       x86_64            7:1.02.170-6.el7_9.5               updates            325 k
libxml2                                  x86_64            2.9.1-6.el7_9.6                    updates            668 k
lvm2-libs                                x86_64            7:2.02.187-6.el7_9.5               updates            1.1 M
Transaction Summary
========================================================================================================================
Install  1 Package  (+3 Dependent packages)
Upgrade  2 Packages (+6 Dependent packages)
Total download size: 5.3 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
warning: /var/cache/yum/x86_64/7/updates/packages/device-mapper-event-libs-1.02.170-6.el7_9.5.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for device-mapper-event-libs-1.02.170-6.el7_9.5.x86_64.rpm is not installed
(1/12): device-mapper-event-libs-1.02.170-6.el7_9.5.x86_64.rpm                                   | 192 kB  00:00:00
(2/12): device-mapper-libs-1.02.170-6.el7_9.5.x86_64.rpm                                         | 325 kB  00:00:00
(3/12): device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64.rpm                                 | 423 kB  00:00:00
(4/12): libxml2-python-2.9.1-6.el7_9.6.x86_64.rpm                                                | 247 kB  00:00:00
(5/12): libxml2-2.9.1-6.el7_9.6.x86_64.rpm                                                       | 668 kB  00:00:00
(6/12): device-mapper-1.02.170-6.el7_9.5.x86_64.rpm                                              | 297 kB  00:00:00
(7/12): lvm2-libs-2.02.187-6.el7_9.5.x86_64.rpm                                                  | 1.1 MB  00:00:00
(8/12): lvm2-2.02.187-6.el7_9.5.x86_64.rpm                                                       | 1.3 MB  00:00:00
Public key for yum-utils-1.1.31-54.el7_8.noarch.rpm is not installed
(9/12): yum-utils-1.1.31-54.el7_8.noarch.rpm                                                     | 122 kB  00:00:00
(10/12): python-kitchen-1.1.1-5.el7.noarch.rpm                                                   | 267 kB  00:00:00
(11/12): python-chardet-2.2.1-3.el7.noarch.rpm                                                   | 227 kB  00:00:00
(12/12): device-mapper-event-1.02.170-6.el7_9.5.x86_64.rpm                                       | 192 kB  00:00:02
------------------------------------------------------------------------------------------------------------------------
Total                                                                                   2.0 MB/s | 5.3 MB  00:00:02
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package    : centos-release-7-5.1804.el7.centos.x86_64 (@anaconda)
From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating   : 7:device-mapper-libs-1.02.170-6.el7_9.5.x86_64                                                      1/20
Updating   : 7:device-mapper-1.02.170-6.el7_9.5.x86_64                                                           2/20
Updating   : 7:device-mapper-event-libs-1.02.170-6.el7_9.5.x86_64                                                3/20
Updating   : 7:device-mapper-event-1.02.170-6.el7_9.5.x86_64                                                     4/20
Updating   : 7:lvm2-libs-2.02.187-6.el7_9.5.x86_64                                                               5/20
Updating   : device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64                                                6/20
Updating   : libxml2-2.9.1-6.el7_9.6.x86_64                                                                      7/20
Installing : libxml2-python-2.9.1-6.el7_9.6.x86_64                                                               8/20
Installing : python-chardet-2.2.1-3.el7.noarch                                                                   9/20
Installing : python-kitchen-1.1.1-5.el7.noarch                                                                  10/20
Installing : yum-utils-1.1.31-54.el7_8.noarch                                                                   11/20
Updating   : 7:lvm2-2.02.187-6.el7_9.5.x86_64                                                                   12/20
Cleanup    : 7:lvm2-2.02.177-4.el7.x86_64                                                                       13/20
Cleanup    : 7:lvm2-libs-2.02.177-4.el7.x86_64                                                                  14/20
Cleanup    : 7:device-mapper-event-1.02.146-4.el7.x86_64                                                        15/20
Cleanup    : 7:device-mapper-event-libs-1.02.146-4.el7.x86_64                                                   16/20
Cleanup    : 7:device-mapper-1.02.146-4.el7.x86_64                                                              17/20
Cleanup    : 7:device-mapper-libs-1.02.146-4.el7.x86_64                                                         18/20
Cleanup    : device-mapper-persistent-data-0.7.3-3.el7.x86_64                                                   19/20
Cleanup    : libxml2-2.9.1-6.el7_2.3.x86_64                                                                     20/20
Verifying  : 7:lvm2-2.02.187-6.el7_9.5.x86_64                                                                    1/20
Verifying  : python-chardet-2.2.1-3.el7.noarch                                                                   2/20
Verifying  : libxml2-2.9.1-6.el7_9.6.x86_64                                                                      3/20
Verifying  : 7:lvm2-libs-2.02.187-6.el7_9.5.x86_64                                                               4/20
Verifying  : 7:device-mapper-1.02.170-6.el7_9.5.x86_64                                                           5/20
Verifying  : libxml2-python-2.9.1-6.el7_9.6.x86_64                                                               6/20
Verifying  : device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64                                                7/20
Verifying  : 7:device-mapper-event-1.02.170-6.el7_9.5.x86_64                                                     8/20
Verifying  : python-kitchen-1.1.1-5.el7.noarch                                                                   9/20
Verifying  : 7:device-mapper-libs-1.02.170-6.el7_9.5.x86_64                                                     10/20
Verifying  : yum-utils-1.1.31-54.el7_8.noarch                                                                   11/20
Verifying  : 7:device-mapper-event-libs-1.02.170-6.el7_9.5.x86_64                                               12/20
Verifying  : device-mapper-persistent-data-0.7.3-3.el7.x86_64                                                   13/20
Verifying  : 7:device-mapper-event-libs-1.02.146-4.el7.x86_64                                                   14/20
Verifying  : libxml2-2.9.1-6.el7_2.3.x86_64                                                                     15/20
Verifying  : 7:device-mapper-1.02.146-4.el7.x86_64                                                              16/20
Verifying  : 7:device-mapper-libs-1.02.146-4.el7.x86_64                                                         17/20
Verifying  : 7:device-mapper-event-1.02.146-4.el7.x86_64                                                        18/20
Verifying  : 7:lvm2-libs-2.02.177-4.el7.x86_64                                                                  19/20
Verifying  : 7:lvm2-2.02.177-4.el7.x86_64                                                                       20/20
Installed:
yum-utils.noarch 0:1.1.31-54.el7_8
Dependency Installed:
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
Updated:
device-mapper-persistent-data.x86_64 0:0.8.5-3.el7_9.2                lvm2.x86_64 7:2.02.187-6.el7_9.5
Dependency Updated:
device-mapper.x86_64 7:1.02.170-6.el7_9.5                     device-mapper-event.x86_64 7:1.02.170-6.el7_9.5
device-mapper-event-libs.x86_64 7:1.02.170-6.el7_9.5          device-mapper-libs.x86_64 7:1.02.170-6.el7_9.5
libxml2.x86_64 0:2.9.1-6.el7_9.6                              lvm2-libs.x86_64 7:2.02.187-6.el7_9.5
Complete!

2: 添加软件源信息

[root@localhost]# sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo

3: 更新并安装 Docker-CE

[root@localhost]# sudo yum makecache fast
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
base                                                                                             | 3.6 kB  00:00:00
docker-ce-stable                                                                                 | 3.5 kB  00:00:00
extras                                                                                           | 2.9 kB  00:00:00
updates                                                                                          | 2.9 kB  00:00:00
(1/2): docker-ce-stable/7/x86_64/updateinfo                                                      |   55 B  00:00:00
(2/2): docker-ce-stable/7/x86_64/primary_db                                                      |  90 kB  00:00:01
Metadata Cache Created
[root@localhost]# sudo yum -y install docker-ce
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:20.10.22-3.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-20.10.22-3.el7.x86_64
--> Processing Dependency: containerd.io >= 1.4.1 for package: 3:docker-ce-20.10.22-3.el7.x86_64
--> Processing Dependency: libseccomp >= 2.3 for package: 3:docker-ce-20.10.22-3.el7.x86_64
--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.22-3.el7.x86_64
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20.10.22-3.el7.x86_64
--> Processing Dependency: libcgroup for package: 3:docker-ce-20.10.22-3.el7.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed
--> Processing Dependency: selinux-policy-targeted >= 3.13.1-216.el7 for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
--> Processing Dependency: selinux-policy-base >= 3.13.1-216.el7 for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
--> Processing Dependency: selinux-policy >= 3.13.1-216.el7 for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
--> Processing Dependency: policycoreutils-python for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
---> Package containerd.io.x86_64 0:1.6.13-3.1.el7 will be installed
---> Package docker-ce-cli.x86_64 1:20.10.22-3.el7 will be installed
--> Processing Dependency: docker-scan-plugin(x86-64) for package: 1:docker-ce-cli-20.10.22-3.el7.x86_64
---> Package docker-ce-rootless-extras.x86_64 0:20.10.22-3.el7 will be installed
--> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-20.10.22-3.el7.x86_64
--> Processing Dependency: slirp4netns >= 0.4 for package: docker-ce-rootless-extras-20.10.22-3.el7.x86_64
---> Package libcgroup.x86_64 0:0.41-21.el7 will be installed
---> Package libseccomp.x86_64 0:2.3.1-4.el7 will be installed
--> Running transaction check
---> Package docker-scan-plugin.x86_64 0:0.23.0-3.el7 will be installed
---> Package fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 will be installed
--> Processing Dependency: libfuse3.so.3(FUSE_3.2)(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
--> Processing Dependency: libfuse3.so.3(FUSE_3.0)(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
--> Processing Dependency: libfuse3.so.3()(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
---> Package policycoreutils-python.x86_64 0:2.5-34.el7 will be installed
--> Processing Dependency: policycoreutils = 2.5-34.el7 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libsemanage-python >= 2.5-14 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
---> Package selinux-policy.noarch 0:3.13.1-192.el7 will be updated
---> Package selinux-policy.noarch 0:3.13.1-268.el7_9.2 will be an update
--> Processing Dependency: libsemanage >= 2.5-13 for package: selinux-policy-3.13.1-268.el7_9.2.noarch
---> Package selinux-policy-targeted.noarch 0:3.13.1-192.el7 will be updated
---> Package selinux-policy-targeted.noarch 0:3.13.1-268.el7_9.2 will be an update
---> Package slirp4netns.x86_64 0:0.4.3-4.el7_8 will be installed
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.8.5-4.el7 will be installed
--> Processing Dependency: audit-libs(x86-64) = 2.8.5-4.el7 for package: audit-libs-python-2.8.5-4.el7.x86_64
---> Package checkpolicy.x86_64 0:2.5-8.el7 will be installed
---> Package fuse3-libs.x86_64 0:3.6.1-4.el7 will be installed
---> Package libsemanage.x86_64 0:2.5-11.el7 will be updated
---> Package libsemanage.x86_64 0:2.5-14.el7 will be an update
--> Processing Dependency: libsepol >= 2.5-10 for package: libsemanage-2.5-14.el7.x86_64
--> Processing Dependency: libselinux >= 2.5-14 for package: libsemanage-2.5-14.el7.x86_64
---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed
---> Package policycoreutils.x86_64 0:2.5-22.el7 will be updated
---> Package policycoreutils.x86_64 0:2.5-34.el7 will be an update
--> Processing Dependency: libselinux-utils >= 2.5-14 for package: policycoreutils-2.5-34.el7.x86_64
---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed
--> Running transaction check
---> Package audit-libs.x86_64 0:2.8.1-3.el7 will be updated
--> Processing Dependency: audit-libs(x86-64) = 2.8.1-3.el7 for package: audit-2.8.1-3.el7.x86_64
---> Package audit-libs.x86_64 0:2.8.5-4.el7 will be an update
---> Package libselinux.x86_64 0:2.5-12.el7 will be updated
--> Processing Dependency: libselinux(x86-64) = 2.5-12.el7 for package: libselinux-python-2.5-12.el7.x86_64
---> Package libselinux.x86_64 0:2.5-15.el7 will be an update
---> Package libselinux-utils.x86_64 0:2.5-12.el7 will be updated
---> Package libselinux-utils.x86_64 0:2.5-15.el7 will be an update
---> Package libsepol.x86_64 0:2.5-8.1.el7 will be updated
---> Package libsepol.x86_64 0:2.5-10.el7 will be an update
--> Running transaction check
---> Package audit.x86_64 0:2.8.1-3.el7 will be updated
---> Package audit.x86_64 0:2.8.5-4.el7 will be an update
---> Package libselinux-python.x86_64 0:2.5-12.el7 will be updated
---> Package libselinux-python.x86_64 0:2.5-15.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================
Package                            Arch            Version                             Repository                 Size
========================================================================================================================
Installing:
docker-ce                          x86_64          3:20.10.22-3.el7                    docker-ce-stable           22 M
Installing for dependencies:
audit-libs-python                  x86_64          2.8.5-4.el7                         base                       76 k
checkpolicy                        x86_64          2.5-8.el7                           base                      295 k
container-selinux                  noarch          2:2.119.2-1.911c772.el7_8           extras                     40 k
containerd.io                      x86_64          1.6.13-3.1.el7                      docker-ce-stable           33 M
docker-ce-cli                      x86_64          1:20.10.22-3.el7                    docker-ce-stable           30 M
docker-ce-rootless-extras          x86_64          20.10.22-3.el7                      docker-ce-stable          8.5 M
docker-scan-plugin                 x86_64          0.23.0-3.el7                        docker-ce-stable          3.8 M
fuse-overlayfs                     x86_64          0.7.2-6.el7_8                       extras                     54 k
fuse3-libs                         x86_64          3.6.1-4.el7                         extras                     82 k
libcgroup                          x86_64          0.41-21.el7                         base                       66 k
libseccomp                         x86_64          2.3.1-4.el7                         base                       56 k
libsemanage-python                 x86_64          2.5-14.el7                          base                      113 k
policycoreutils-python             x86_64          2.5-34.el7                          base                      457 k
python-IPy                         noarch          0.75-6.el7                          base                       32 k
setools-libs                       x86_64          3.3.8-4.el7                         base                      620 k
slirp4netns                        x86_64          0.4.3-4.el7_8                       extras                     81 k
Updating for dependencies:
audit                              x86_64          2.8.5-4.el7                         base                      256 k
audit-libs                         x86_64          2.8.5-4.el7                         base                      102 k
libselinux                         x86_64          2.5-15.el7                          base                      162 k
libselinux-python                  x86_64          2.5-15.el7                          base                      236 k
libselinux-utils                   x86_64          2.5-15.el7                          base                      151 k
libsemanage                        x86_64          2.5-14.el7                          base                      151 k
libsepol                           x86_64          2.5-10.el7                          base                      297 k
policycoreutils                    x86_64          2.5-34.el7                          base                      917 k
selinux-policy                     noarch          3.13.1-268.el7_9.2                  updates                   498 k
selinux-policy-targeted            noarch          3.13.1-268.el7_9.2                  updates                   7.0 M
Transaction Summary
========================================================================================================================
Install  1 Package  (+16 Dependent packages)
Upgrade             ( 10 Dependent packages)
Total download size: 108 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/27): audit-2.8.5-4.el7.x86_64.rpm                                                             | 256 kB  00:00:00
(2/27): checkpolicy-2.5-8.el7.x86_64.rpm                                                         | 295 kB  00:00:00
(3/27): audit-libs-2.8.5-4.el7.x86_64.rpm                                                        | 102 kB  00:00:00
(4/27): audit-libs-python-2.8.5-4.el7.x86_64.rpm                                                 |  76 kB  00:00:00
(5/27): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm                                     |  40 kB  00:00:00
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-ce-20.10.22-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Public key for docker-ce-20.10.22-3.el7.x86_64.rpm is not installed
(6/27): docker-ce-20.10.22-3.el7.x86_64.rpm                                                      |  22 MB  00:02:14
(7/27): containerd.io-1.6.13-3.1.el7.x86_64.rpm                                                  |  33 MB  00:03:26
(8/27): docker-ce-rootless-extras-20.10.22-3.el7.x86_64.rpm                                      | 8.5 MB  00:00:52
(9/27): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm                                                  |  54 kB  00:00:00
(10/27): libcgroup-0.41-21.el7.x86_64.rpm                                                        |  66 kB  00:00:00
(11/27): libseccomp-2.3.1-4.el7.x86_64.rpm                                                       |  56 kB  00:00:00
(12/27): libselinux-python-2.5-15.el7.x86_64.rpm                                                 | 236 kB  00:00:00
(13/27): libselinux-utils-2.5-15.el7.x86_64.rpm                                                  | 151 kB  00:00:00
(14/27): libsemanage-2.5-14.el7.x86_64.rpm                                                       | 151 kB  00:00:00
(15/27): libsemanage-python-2.5-14.el7.x86_64.rpm                                                | 113 kB  00:00:00
(16/27): libsepol-2.5-10.el7.x86_64.rpm                                                          | 297 kB  00:00:00
(17/27): policycoreutils-2.5-34.el7.x86_64.rpm                                                   | 917 kB  00:00:00
(18/27): fuse3-libs-3.6.1-4.el7.x86_64.rpm                                                       |  82 kB  00:00:01
(19/27): policycoreutils-python-2.5-34.el7.x86_64.rpm                                            | 457 kB  00:00:00
(20/27): libselinux-2.5-15.el7.x86_64.rpm                                                        | 162 kB  00:00:01
(21/27): python-IPy-0.75-6.el7.noarch.rpm                                                        |  32 kB  00:00:00
(22/27): setools-libs-3.3.8-4.el7.x86_64.rpm                                                     | 620 kB  00:00:00
(23/27): slirp4netns-0.4.3-4.el7_8.x86_64.rpm                                                    |  81 kB  00:00:00
(24/27): selinux-policy-3.13.1-268.el7_9.2.noarch.rpm                                            | 498 kB  00:00:01
(25/27): selinux-policy-targeted-3.13.1-268.el7_9.2.noarch.rpm                                   | 7.0 MB  00:00:01
(26/27): docker-scan-plugin-0.23.0-3.el7.x86_64.rpm                                              | 3.8 MB  00:00:24
(27/27): docker-ce-cli-20.10.22-3.el7.x86_64.rpm                                                 |  30 MB  00:03:07
------------------------------------------------------------------------------------------------------------------------
Total                                                                                   343 kB/s | 108 MB  00:05:22
Retrieving key from https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
Importing GPG key 0x621E9F35:
Userid     : "Docker Release (CE rpm) <docker@docker.com>"
Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
From       : https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating   : libsepol-2.5-10.el7.x86_64                                                                          1/37
Updating   : libselinux-2.5-15.el7.x86_64                                                                        2/37
Updating   : audit-libs-2.8.5-4.el7.x86_64                                                                       3/37
Updating   : libsemanage-2.5-14.el7.x86_64                                                                       4/37
Installing : libseccomp-2.3.1-4.el7.x86_64                                                                       5/37
Updating   : libselinux-utils-2.5-15.el7.x86_64                                                                  6/37
Updating   : policycoreutils-2.5-34.el7.x86_64                                                                   7/37
Updating   : selinux-policy-3.13.1-268.el7_9.2.noarch                                                            8/37
Installing : libcgroup-0.41-21.el7.x86_64                                                                        9/37
Updating   : selinux-policy-targeted-3.13.1-268.el7_9.2.noarch                                                  10/37
Installing : slirp4netns-0.4.3-4.el7_8.x86_64                                                                   11/37
Installing : libsemanage-python-2.5-14.el7.x86_64                                                               12/37
Installing : audit-libs-python-2.8.5-4.el7.x86_64                                                               13/37
Installing : setools-libs-3.3.8-4.el7.x86_64                                                                    14/37
Updating   : libselinux-python-2.5-15.el7.x86_64                                                                15/37
Installing : docker-scan-plugin-0.23.0-3.el7.x86_64                                                             16/37
Installing : 1:docker-ce-cli-20.10.22-3.el7.x86_64                                                              17/37
Installing : python-IPy-0.75-6.el7.noarch                                                                       18/37
Installing : checkpolicy-2.5-8.el7.x86_64                                                                       19/37
Installing : policycoreutils-python-2.5-34.el7.x86_64                                                           20/37
Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                                 21/37
Installing : containerd.io-1.6.13-3.1.el7.x86_64                                                                22/37
Installing : fuse3-libs-3.6.1-4.el7.x86_64                                                                      23/37
Installing : fuse-overlayfs-0.7.2-6.el7_8.x86_64                                                                24/37
Installing : docker-ce-rootless-extras-20.10.22-3.el7.x86_64                                                    25/37
Installing : 3:docker-ce-20.10.22-3.el7.x86_64                                                                  26/37
Updating   : audit-2.8.5-4.el7.x86_64                                                                           27/37
Cleanup    : selinux-policy-targeted-3.13.1-192.el7.noarch                                                      28/37
Cleanup    : selinux-policy-3.13.1-192.el7.noarch                                                               29/37
Cleanup    : policycoreutils-2.5-22.el7.x86_64                                                                  30/37
Cleanup    : libsemanage-2.5-11.el7.x86_64                                                                      31/37
Cleanup    : libselinux-utils-2.5-12.el7.x86_64                                                                 32/37
Cleanup    : libselinux-python-2.5-12.el7.x86_64                                                                33/37
Cleanup    : libselinux-2.5-12.el7.x86_64                                                                       34/37
Cleanup    : audit-2.8.1-3.el7.x86_64                                                                           35/37
Cleanup    : audit-libs-2.8.1-3.el7.x86_64                                                                      36/37
Cleanup    : libsepol-2.5-8.1.el7.x86_64                                                                        37/37
Verifying  : 3:docker-ce-20.10.22-3.el7.x86_64                                                                   1/37
Verifying  : fuse-overlayfs-0.7.2-6.el7_8.x86_64                                                                 2/37
Verifying  : libselinux-2.5-15.el7.x86_64                                                                        3/37
Verifying  : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                                  4/37
Verifying  : fuse3-libs-3.6.1-4.el7.x86_64                                                                       5/37
Verifying  : selinux-policy-targeted-3.13.1-268.el7_9.2.noarch                                                   6/37
Verifying  : audit-libs-2.8.5-4.el7.x86_64                                                                       7/37
Verifying  : checkpolicy-2.5-8.el7.x86_64                                                                        8/37
Verifying  : docker-ce-rootless-extras-20.10.22-3.el7.x86_64                                                     9/37
Verifying  : policycoreutils-2.5-34.el7.x86_64                                                                  10/37
Verifying  : python-IPy-0.75-6.el7.noarch                                                                       11/37
Verifying  : libseccomp-2.3.1-4.el7.x86_64                                                                      12/37
Verifying  : libselinux-utils-2.5-15.el7.x86_64                                                                 13/37
Verifying  : policycoreutils-python-2.5-34.el7.x86_64                                                           14/37
Verifying  : setools-libs-3.3.8-4.el7.x86_64                                                                    15/37
Verifying  : libsemanage-python-2.5-14.el7.x86_64                                                               16/37
Verifying  : docker-scan-plugin-0.23.0-3.el7.x86_64                                                             17/37
Verifying  : audit-2.8.5-4.el7.x86_64                                                                           18/37
Verifying  : containerd.io-1.6.13-3.1.el7.x86_64                                                                19/37
Verifying  : libsemanage-2.5-14.el7.x86_64                                                                      20/37
Verifying  : slirp4netns-0.4.3-4.el7_8.x86_64                                                                   21/37
Verifying  : 1:docker-ce-cli-20.10.22-3.el7.x86_64                                                              22/37
Verifying  : libselinux-python-2.5-15.el7.x86_64                                                                23/37
Verifying  : selinux-policy-3.13.1-268.el7_9.2.noarch                                                           24/37
Verifying  : audit-libs-python-2.8.5-4.el7.x86_64                                                               25/37
Verifying  : libsepol-2.5-10.el7.x86_64                                                                         26/37
Verifying  : libcgroup-0.41-21.el7.x86_64                                                                       27/37
Verifying  : libsemanage-2.5-11.el7.x86_64                                                                      28/37
Verifying  : libselinux-python-2.5-12.el7.x86_64                                                                29/37
Verifying  : audit-libs-2.8.1-3.el7.x86_64                                                                      30/37
Verifying  : policycoreutils-2.5-22.el7.x86_64                                                                  31/37
Verifying  : libsepol-2.5-8.1.el7.x86_64                                                                        32/37
Verifying  : audit-2.8.1-3.el7.x86_64                                                                           33/37
Verifying  : selinux-policy-3.13.1-192.el7.noarch                                                               34/37
Verifying  : libselinux-2.5-12.el7.x86_64                                                                       35/37
Verifying  : libselinux-utils-2.5-12.el7.x86_64                                                                 36/37
Verifying  : selinux-policy-targeted-3.13.1-192.el7.noarch                                                      37/37
Installed:
docker-ce.x86_64 3:20.10.22-3.el7
Dependency Installed:
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          containerd.io.x86_64 0:1.6.13-3.1.el7
docker-ce-cli.x86_64 1:20.10.22-3.el7                       docker-ce-rootless-extras.x86_64 0:20.10.22-3.el7
docker-scan-plugin.x86_64 0:0.23.0-3.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
libseccomp.x86_64 0:2.3.1-4.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
Dependency Updated:
audit.x86_64 0:2.8.5-4.el7                             audit-libs.x86_64 0:2.8.5-4.el7
libselinux.x86_64 0:2.5-15.el7                         libselinux-python.x86_64 0:2.5-15.el7
libselinux-utils.x86_64 0:2.5-15.el7                   libsemanage.x86_64 0:2.5-14.el7
libsepol.x86_64 0:2.5-10.el7                           policycoreutils.x86_64 0:2.5-34.el7
selinux-policy.noarch 0:3.13.1-268.el7_9.2             selinux-policy-targeted.noarch 0:3.13.1-268.el7_9.2
Complete!

4: 开启Docker服务

[root@localhost]# sudo service docker start
Redirecting to /bin/systemctl start docker.service

其他

# 安装指定版本的Docker-CE:
# Step 1: 查找Docker-CE的版本:
# yum list docker-ce.x86_64 --showduplicates | sort -r
#   Loading mirror speeds from cached hostfile
#   Loaded plugins: branch, fastestmirror, langpacks
#   docker-ce.x86_64            17.03.1.ce-1.el7.centos            docker-ce-stable
#   docker-ce.x86_64            17.03.1.ce-1.el7.centos            @docker-ce-stable
#   docker-ce.x86_64            17.03.0.ce-1.el7.centos            docker-ce-stable
#   Available Packages
# Step2 : 安装指定版本的Docker-CE: (VERSION 例如上面的 17.03.0.ce.1-1.el7.centos)
# sudo yum -y install docker-ce-[VERSION]
# 注意:在某些版本之后,docker-ce安装出现了其他依赖包,如果安装失败的话请关注错误信息。例如 docker-ce 17.03 之后,需要先安装 docker-ce-selinux。
# yum list docker-ce-selinux- --showduplicates | sort -r
# sudo yum -y install docker-ce-selinux-[VERSION]
# 通过经典网络、VPC网络内网安装时,用以下命令替换Step 2中的命令
# 经典网络:
# sudo yum-config-manager --add-repo http://mirrors.aliyuncs.com/docker-ce/linux/centos/docker-ce.repo
# VPC网络:
# sudo yum-config-manager --add-repo http://mirrors.could.aliyuncs.com/docker-ce/linux/centos/docker-ce.repo
This entry was posted in 默认分类. Bookmark the permalink.