Centos7 安装Docker

安装依赖

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

执行日志:

Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirror.bit.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirror.bit.edu.cn
base                                                                                                                                                    | 3.6 kB  00:00:00     
extras                                                                                                                                                  | 3.4 kB  00:00:00     
updates                                                                                                                                                 | 3.4 kB  00:00:00     
(1/4): base/7/x86_64/group_gz                                                                                                                           | 166 kB  00:00:02     
(2/4): extras/7/x86_64/primary_db                                                                                                                       | 205 kB  00:00:06     
(3/4): base/7/x86_64/primary_db                                                                                                                         | 6.0 MB  00:00:59     
(4/4): updates/7/x86_64/primary_db                                                                                                                      | 6.4 MB  00:01:03     
Package device-mapper-persistent-data-0.7.3-3.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package lvm2.x86_64 7:2.02.180-8.el7 will be updated
---> Package lvm2.x86_64 7:2.02.180-10.el7_6.7 will be an update
--> Processing Dependency: lvm2-libs = 7:2.02.180-10.el7_6.7 for package: 7:lvm2-2.02.180-10.el7_6.7.x86_64
---> Package yum-utils.noarch 0:1.1.31-50.el7 will be installed
--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-50.el7.noarch
--> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-50.el7.noarch
--> Running transaction check
---> Package libxml2-python.x86_64 0:2.9.1-6.el7_2.3 will be installed
---> Package lvm2-libs.x86_64 7:2.02.180-8.el7 will be updated
---> Package lvm2-libs.x86_64 7:2.02.180-10.el7_6.7 will be an update
--> Processing Dependency: device-mapper-event = 7:1.02.149-10.el7_6.7 for package: 7:lvm2-libs-2.02.180-10.el7_6.7.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.149-8.el7 will be updated
---> Package device-mapper-event.x86_64 7:1.02.149-10.el7_6.7 will be an update
--> Processing Dependency: device-mapper-event-libs = 7:1.02.149-10.el7_6.7 for package: 7:device-mapper-event-1.02.149-10.el7_6.7.x86_64
--> Processing Dependency: device-mapper = 7:1.02.149-10.el7_6.7 for package: 7:device-mapper-event-1.02.149-10.el7_6.7.x86_64
---> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be installed
--> Running transaction check
---> Package device-mapper.x86_64 7:1.02.149-8.el7 will be updated
--> Processing Dependency: device-mapper = 7:1.02.149-8.el7 for package: 7:device-mapper-libs-1.02.149-8.el7.x86_64
---> Package device-mapper.x86_64 7:1.02.149-10.el7_6.7 will be an update
---> Package device-mapper-event-libs.x86_64 7:1.02.149-8.el7 will be updated
---> Package device-mapper-event-libs.x86_64 7:1.02.149-10.el7_6.7 will be an update
--> Running transaction check
---> Package device-mapper-libs.x86_64 7:1.02.149-8.el7 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.149-10.el7_6.7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================
 Package                                            Arch                             Version                                           Repository                         Size
===============================================================================================================================================================================
Installing:
 yum-utils                                          noarch                           1.1.31-50.el7                                     base                              121 k
Updating:
 lvm2                                               x86_64                           7:2.02.180-10.el7_6.7                             updates                           1.3 M
Installing for dependencies:
 libxml2-python                                     x86_64                           2.9.1-6.el7_2.3                                   base                              247 k
 python-chardet                                     noarch                           2.2.1-1.el7_1                                     base                              227 k
 python-kitchen                                     noarch                           1.1.1-5.el7                                       base                              267 k
Updating for dependencies:
 device-mapper                                      x86_64                           7:1.02.149-10.el7_6.7                             updates                           293 k
 device-mapper-event                                x86_64                           7:1.02.149-10.el7_6.7                             updates                           189 k
 device-mapper-event-libs                           x86_64                           7:1.02.149-10.el7_6.7                             updates                           188 k
 device-mapper-libs                                 x86_64                           7:1.02.149-10.el7_6.7                             updates                           320 k
 lvm2-libs                                          x86_64                           7:2.02.180-10.el7_6.7                             updates                           1.1 M

Transaction Summary
===============================================================================================================================================================================
Install  1 Package (+3 Dependent packages)
Upgrade  1 Package (+5 Dependent packages)

Total download size: 4.2 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.149-10.el7_6.7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY 00:00:21 ETA 
Public key for device-mapper-event-libs-1.02.149-10.el7_6.7.x86_64.rpm is not installed
(1/10): device-mapper-event-libs-1.02.149-10.el7_6.7.x86_64.rpm                                                                                         | 188 kB  00:00:04     
(2/10): device-mapper-event-1.02.149-10.el7_6.7.x86_64.rpm                                                                                              | 189 kB  00:00:04     
Public key for libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm is not installed23% [==============-                                                ] 165 kB/s | 1.0 MB  00:00:19 ETA 
(3/10): libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm                                                                                                       | 247 kB  00:00:05     
(4/10): device-mapper-1.02.149-10.el7_6.7.x86_64.rpm                                                                                                    | 293 kB  00:00:06     
(5/10): python-chardet-2.2.1-1.el7_1.noarch.rpm                                                                                                         | 227 kB  00:00:05     
(6/10): python-kitchen-1.1.1-5.el7.noarch.rpm                                                                                                           | 267 kB  00:00:05     
(7/10): yum-utils-1.1.31-50.el7.noarch.rpm                                                                                                              | 121 kB  00:00:02     
(8/10): device-mapper-libs-1.02.149-10.el7_6.7.x86_64.rpm                                                                                               | 320 kB  00:00:14     
(9/10): lvm2-libs-2.02.180-10.el7_6.7.x86_64.rpm                                                                                                        | 1.1 MB  00:00:15     
(10/10): lvm2-2.02.180-10.el7_6.7.x86_64.rpm                                                                                                            | 1.3 MB  00:00:17     
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                          200 kB/s | 4.2 MB  00:00:21     
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) "
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-6.1810.2.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-1.02.149-10.el7_6.7.x86_64                                                                                                                 1/16 
  Updating   : 7:device-mapper-libs-1.02.149-10.el7_6.7.x86_64                                                                                                            2/16 
  Updating   : 7:device-mapper-event-libs-1.02.149-10.el7_6.7.x86_64                                                                                                      3/16 
  Updating   : 7:device-mapper-event-1.02.149-10.el7_6.7.x86_64                                                                                                           4/16 
  Updating   : 7:lvm2-libs-2.02.180-10.el7_6.7.x86_64                                                                                                                     5/16 
  Installing : python-chardet-2.2.1-1.el7_1.noarch                                                                                                                        6/16 
  Installing : python-kitchen-1.1.1-5.el7.noarch                                                                                                                          7/16 
  Installing : libxml2-python-2.9.1-6.el7_2.3.x86_64                                                                                                                      8/16 
  Installing : yum-utils-1.1.31-50.el7.noarch                                                                                                                             9/16 
  Updating   : 7:lvm2-2.02.180-10.el7_6.7.x86_64                                                                                                                         10/16 
  Cleanup    : 7:lvm2-2.02.180-8.el7.x86_64                                                                                                                              11/16 
  Cleanup    : 7:lvm2-libs-2.02.180-8.el7.x86_64                                                                                                                         12/16 
  Cleanup    : 7:device-mapper-event-1.02.149-8.el7.x86_64                                                                                                               13/16 
  Cleanup    : 7:device-mapper-event-libs-1.02.149-8.el7.x86_64                                                                                                          14/16 
  Cleanup    : 7:device-mapper-1.02.149-8.el7.x86_64                                                                                                                     15/16 
  Cleanup    : 7:device-mapper-libs-1.02.149-8.el7.x86_64                                                                                                                16/16 
  Verifying  : 7:device-mapper-libs-1.02.149-10.el7_6.7.x86_64                                                                                                            1/16 
  Verifying  : yum-utils-1.1.31-50.el7.noarch                                                                                                                             2/16 
  Verifying  : 7:device-mapper-event-libs-1.02.149-10.el7_6.7.x86_64                                                                                                      3/16 
  Verifying  : libxml2-python-2.9.1-6.el7_2.3.x86_64                                                                                                                      4/16 
  Verifying  : python-chardet-2.2.1-1.el7_1.noarch                                                                                                                        5/16 
  Verifying  : python-kitchen-1.1.1-5.el7.noarch                                                                                                                          6/16 
  Verifying  : 7:lvm2-libs-2.02.180-10.el7_6.7.x86_64                                                                                                                     7/16 
  Verifying  : 7:lvm2-2.02.180-10.el7_6.7.x86_64                                                                                                                          8/16 
  Verifying  : 7:device-mapper-event-1.02.149-10.el7_6.7.x86_64                                                                                                           9/16 
  Verifying  : 7:device-mapper-1.02.149-10.el7_6.7.x86_64                                                                                                                10/16 
  Verifying  : 7:lvm2-2.02.180-8.el7.x86_64                                                                                                                              11/16 
  Verifying  : 7:lvm2-libs-2.02.180-8.el7.x86_64                                                                                                                         12/16 
  Verifying  : 7:device-mapper-1.02.149-8.el7.x86_64                                                                                                                     13/16 
  Verifying  : 7:device-mapper-libs-1.02.149-8.el7.x86_64                                                                                                                14/16 
  Verifying  : 7:device-mapper-event-1.02.149-8.el7.x86_64                                                                                                               15/16 
  Verifying  : 7:device-mapper-event-libs-1.02.149-8.el7.x86_64                                                                                                          16/16 

Installed:
  yum-utils.noarch 0:1.1.31-50.el7                                                                                                                                             

Dependency Installed:
  libxml2-python.x86_64 0:2.9.1-6.el7_2.3                     python-chardet.noarch 0:2.2.1-1.el7_1                     python-kitchen.noarch 0:1.1.1-5.el7                    

Updated:
  lvm2.x86_64 7:2.02.180-10.el7_6.7                                                                                                                                            

Dependency Updated:
  device-mapper.x86_64 7:1.02.149-10.el7_6.7             device-mapper-event.x86_64 7:1.02.149-10.el7_6.7        device-mapper-event-libs.x86_64 7:1.02.149-10.el7_6.7       
  device-mapper-libs.x86_64 7:1.02.149-10.el7_6.7        lvm2-libs.x86_64 7:2.02.180-10.el7_6.7                 

Complete!

添加yum软件源

sudo yum-config-manager --add-repo https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo

执行日志:

Loaded plugins: fastestmirror
adding repo from: https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
grabbing file https://mirrors.ustc.edu.cn/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

安装Docker

yum install docker-ce

配置镜像加速

https://cr.console.aliyun.com/#/accelerator
Centos7 安装Docker_第1张图片

你可能感兴趣的:(docker相关)